{"action":"closed","number":11921,"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/11921","id":40986337,"html_url":"https://github.com/kubernetes/kubernetes/pull/11921","diff_url":"https://github.com/kubernetes/kubernetes/pull/11921.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/11921.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/11921","number":11921,"state":"closed","locked":false,"title":"Implement multi-scheduler (Open to discussion)","user":{"login":"HaiyangDING","id":11399486,"avatar_url":"https://avatars.githubusercontent.com/u/11399486?v=3","gravatar_id":"","url":"https://api.github.com/users/HaiyangDING","html_url":"https://github.com/HaiyangDING","followers_url":"https://api.github.com/users/HaiyangDING/followers","following_url":"https://api.github.com/users/HaiyangDING/following{/other_user}","gists_url":"https://api.github.com/users/HaiyangDING/gists{/gist_id}","starred_url":"https://api.github.com/users/HaiyangDING/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaiyangDING/subscriptions","organizations_url":"https://api.github.com/users/HaiyangDING/orgs","repos_url":"https://api.github.com/users/HaiyangDING/repos","events_url":"https://api.github.com/users/HaiyangDING/events{/privacy}","received_events_url":"https://api.github.com/users/HaiyangDING/received_events","type":"User","site_admin":false},"body":"This PR tries to implement multi-scheduler feature for Kubernetes. The design is open to discussion and there are still many things to decide (e.g. namespaces, trust model, admission control, adding pod spec, logs, etc). Please leave your comments here or in issue https://github.com/GoogleCloudPlatform/kubernetes/issues/11793\r\n\r\nI have tested in my local environment (`cluster/local-up-cluster.sh`) and it works. The main idea is to register multiple algorithm providers when the scheduler starts, so there would be only one scheduler process at any time (same as it is now). See the following lines for a brief idea. For more info please look at the code and I am happy with any discussion.\r\n\r\n1. Multiple algorithm providers are registered when scheduler starts\r\n2. Each algorithm provider has a name\r\n3. A pod can specify which algorithm provider to use. How to specify is open to discuss, and in this version, we check if there is a Label [`\"policy\": <provider-name>`] in Pod's metadata labels. If there is an algorithm provider registered with name `<provider-name>`, then it is applied; otherwise(`<provider-name>` not registered or no Label with key `\"policy\"`), use default provider\r\n4. There is a default provider\r\n5. There are still many things to do, this is just a start.\r\n\r\nPS: package myscheduler (./plugin/pkg/scheduler/algorithmprovider/myscheduler/myscheduler.go) is for testing\r\n\r\n**Example**\r\n\r\nI will explain how this multi-scheduler works through an example. Just clone my fork and it should work for you.\r\n\r\n1. one node in the cluster\r\n2. two algorithm providers (`DefaultProvider` and `MyScheduler`)\r\n - `DefaultProvider` checks `PodFitsPorts` in predicate phase\r\n - `MyScheduler` **DOES NOT** check `PodFitsPorts` in predicate phase\r\n3. The pod template is given below. Create a *first* pod with the template and it is scheduled to my only node\r\n4. Change the pod id and create a *second* pod using this template.\r\n    - You should see that the pod is failed to be scheduled.\r\n    - Use `describe pod <pod-name>`, it is shown in the Reason field `failedScheduling` and Message `Failed for reason PodFitsPorts and possibly others`. \r\n    - Note that this pod specifies its preferred algorithm with Label `policy: DefaultProvider` which checks `PodFitsPorts`, so the `DefaultProvider` works fine.\r\n5. Now it is time to use `MyScheduler` as preferred algorithm provider to create a *third* pod.\r\n    - Change the pod id and change Label `policy: DefaultProvider` to `policy: MySchdeduler`\r\n    - Create a third pod with changed template\r\n    - You should see in `describe pod <pod-name>` that the pod is successfully scheduled, no `failedScheduling` is reported.\r\n    - It shows that the algorithm provider `MyScheduler` works as intended.\r\n    - PS: This third pod will never be ready since kubelet would notice there is a host port conflict.\r\n\r\npod template:\r\n```\r\nid: apache\r\nkind: Pod\r\napiVersion: v1\r\nmetadata:\r\n  name: apache\r\n  labels:\r\n    app: apache\r\n    policy: DefaultProvider\r\nspec:\r\n  hostNetwork: true\r\n  containers:\r\n    - name: apachecontainer\r\n      image: test/apache:1\r\n      ports:\r\n        - name: testport\r\n          protocol: TCP\r\n          containerPort: 1234\r\n          hostPort: 1234\r\n```","created_at":"2015-07-28T08:26:30Z","updated_at":"2015-09-19T03:08:14Z","closed_at":"2015-09-19T03:08:14Z","merged_at":null,"merge_commit_sha":"e12c8e236c3954dda99758d61c26537dfa774162","assignee":{"login":"davidopp","id":8264113,"avatar_url":"https://avatars.githubusercontent.com/u/8264113?v=3","gravatar_id":"","url":"https://api.github.com/users/davidopp","html_url":"https://github.com/davidopp","followers_url":"https://api.github.com/users/davidopp/followers","following_url":"https://api.github.com/users/davidopp/following{/other_user}","gists_url":"https://api.github.com/users/davidopp/gists{/gist_id}","starred_url":"https://api.github.com/users/davidopp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidopp/subscriptions","organizations_url":"https://api.github.com/users/davidopp/orgs","repos_url":"https://api.github.com/users/davidopp/repos","events_url":"https://api.github.com/users/davidopp/events{/privacy}","received_events_url":"https://api.github.com/users/davidopp/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/11921/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/11921/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/11921/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/d11dfbd545655b14d7d8674d9f78ed6dd0cb9819","head":{"label":"HaiyangDING:multi-scheduler","ref":"multi-scheduler","sha":"d11dfbd545655b14d7d8674d9f78ed6dd0cb9819","user":{"login":"HaiyangDING","id":11399486,"avatar_url":"https://avatars.githubusercontent.com/u/11399486?v=3","gravatar_id":"","url":"https://api.github.com/users/HaiyangDING","html_url":"https://github.com/HaiyangDING","followers_url":"https://api.github.com/users/HaiyangDING/followers","following_url":"https://api.github.com/users/HaiyangDING/following{/other_user}","gists_url":"https://api.github.com/users/HaiyangDING/gists{/gist_id}","starred_url":"https://api.github.com/users/HaiyangDING/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaiyangDING/subscriptions","organizations_url":"https://api.github.com/users/HaiyangDING/orgs","repos_url":"https://api.github.com/users/HaiyangDING/repos","events_url":"https://api.github.com/users/HaiyangDING/events{/privacy}","received_events_url":"https://api.github.com/users/HaiyangDING/received_events","type":"User","site_admin":false},"repo":{"id":33019331,"name":"kubernetes","full_name":"HaiyangDING/kubernetes","owner":{"login":"HaiyangDING","id":11399486,"avatar_url":"https://avatars.githubusercontent.com/u/11399486?v=3","gravatar_id":"","url":"https://api.github.com/users/HaiyangDING","html_url":"https://github.com/HaiyangDING","followers_url":"https://api.github.com/users/HaiyangDING/followers","following_url":"https://api.github.com/users/HaiyangDING/following{/other_user}","gists_url":"https://api.github.com/users/HaiyangDING/gists{/gist_id}","starred_url":"https://api.github.com/users/HaiyangDING/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaiyangDING/subscriptions","organizations_url":"https://api.github.com/users/HaiyangDING/orgs","repos_url":"https://api.github.com/users/HaiyangDING/repos","events_url":"https://api.github.com/users/HaiyangDING/events{/privacy}","received_events_url":"https://api.github.com/users/HaiyangDING/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HaiyangDING/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/HaiyangDING/kubernetes","forks_url":"https://api.github.com/repos/HaiyangDING/kubernetes/forks","keys_url":"https://api.github.com/repos/HaiyangDING/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HaiyangDING/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HaiyangDING/kubernetes/teams","hooks_url":"https://api.github.com/repos/HaiyangDING/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/HaiyangDING/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/HaiyangDING/kubernetes/events","assignees_url":"https://api.github.com/repos/HaiyangDING/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/HaiyangDING/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/HaiyangDING/kubernetes/tags","blobs_url":"https://api.github.com/repos/HaiyangDING/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HaiyangDING/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HaiyangDING/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/HaiyangDING/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HaiyangDING/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/HaiyangDING/kubernetes/languages","stargazers_url":"https://api.github.com/repos/HaiyangDING/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/HaiyangDING/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/HaiyangDING/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/HaiyangDING/kubernetes/subscription","commits_url":"https://api.github.com/repos/HaiyangDING/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/HaiyangDING/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/HaiyangDING/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/HaiyangDING/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/HaiyangDING/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/HaiyangDING/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HaiyangDING/kubernetes/merges","archive_url":"https://api.github.com/repos/HaiyangDING/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HaiyangDING/kubernetes/downloads","issues_url":"https://api.github.com/repos/HaiyangDING/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/HaiyangDING/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/HaiyangDING/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/HaiyangDING/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HaiyangDING/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/HaiyangDING/kubernetes/releases{/id}","created_at":"2015-03-28T03:14:48Z","updated_at":"2015-04-21T06:20:07Z","pushed_at":"2015-09-15T16:53:16Z","git_url":"git://github.com/HaiyangDING/kubernetes.git","ssh_url":"git@github.com:HaiyangDING/kubernetes.git","clone_url":"https://github.com/HaiyangDING/kubernetes.git","svn_url":"https://github.com/HaiyangDING/kubernetes","homepage":"http://kubernetes.io","size":106643,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"44fa48e5af44d3e988fa943d96a2de732d8cc666","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-09-19T03:02:59Z","pushed_at":"2015-09-19T03:02:09Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":418010,"stargazers_count":10317,"watchers_count":10317,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2554,"mirror_url":null,"open_issues_count":1791,"forks":2554,"open_issues":1791,"watchers":10317,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/11921"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/11921"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/11921"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/11921/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/11921/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/11921/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/d11dfbd545655b14d7d8674d9f78ed6dd0cb9819"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":15,"review_comments":0,"commits":2,"additions":1260,"deletions":1066,"changed_files":10}}