{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/community/pulls/comments/224571922","pull_request_review_id":163973622,"id":224571922,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDU3MTkyMg==","diff_hunk":"@@ -0,0 +1,174 @@\n+---\n+kep-number: 24\n+title: Coscheduling\n+authors:\n+  - \"@k82cn\"\n+owning-sig: sig-scheduling, machine-learning WG\n+reviewers:\n+  - \"@bsalamat\"\n+  - \"@vishh\"\n+approvers:\n+  - \"@bsalamat\"\n+  - \"@vishh\"\n+editor: TBD\n+creation-date: 2018-07-03\n+last-updated: 2018-09-06\n+status: provisional\n+---\n+\n+# Coscheduling\n+\n+## Table of Contents\n+\n+* [Table of Contents](#table-of-contents)\n+* [Motivation](#motivation)\n+* [Function Detail](#function%20detail)\n+  * [API Definitation](#api%20definition)\n+  * [Lifecycle Management](#lifecycle%20management)\n+  * [kube-arbitrator](#kube-arbitrator)\n+  * [Customized Controller](#customized%20controller)\n+* [Feature Interaction](#feature%20interaction)\n+  * [Multi-scheduler](#multi-scheduler)\n+  * [Priority/Preemption](#priority/preemption)\n+  * [Pod RestartPolicy](#pod%20restartPolicy)\n+  * [Admission Controller](#admission%20controller)\n+  * [Kubectl](#kubectl)\n+* [References](#references)\n+\n+## Motivation\n+\n+After the discussion at [Coscheduling](https://docs.google.com/document/d/1AUwcvTtULNvow5M9e428FnlvINO1uQ7ojRoTGuTp4DA/edit#heading=h.ckn8nv2jj0xv) proposal, we decide to implement Coscheduling in [kube-arbitrator](https://github.com/kubernetes-incubator/kube-arbitrator) by CRDs. kube-arbitrator focuses on \"batch\" workload in kubernetes, and will share the same [scheduling frameworks](https://github.com/kubernetes/community/pull/2281) when it's ready. This document is used to provide definition of API object and the scheduler behaviour of Coscheduling.\n+\n+## Function Detail\n+\n+### API Definition\n+\n+The following requirements are identified during the discussion of this feature:\n+\n+1. Existing workload can use this feature without (or with a few) configuration changes\n+2. Pods of a group/gang may have different `PodSpec` (and/or belong to different collections)\n+3. Existing controllers which are responsible for managing life cycle of collections work well with this feature\n+\n+To meet the requirements above, the following **Kind** is introduced in core part under `scheduling.k8s.io/v1alpha1` **Group**/**Version**.\n+\n+```go\n+// PodGroup defines the scheduling requirement of a pod group\n+type PodGroup struct {\n+    metav1.TypeMeta\n+    metav1.ObjectMeta\n+\n+\t// Spec defines the behavior of a pod group.\n+\t// +optional\n+    Spec PodGroupSpec\n+\n+\t// Status represents the current information about a pod group.\n+\t// This data may not be up to date.\n+\t// +optional\n+    Status PodGroupStatus\n+}\n+\n+// PodGroupSpec represents the template of a pod group.\n+type PodGroupSpec struct {\n+    // NumMember defines the number of members/tasks to run the pod group;\n+    // if there's not enough resources to start all tasks, the scheduler\n+    // will not start anyone.\n+    NumMember int\n+\n+    // Resources defines the total resource the PodGroup requests to run\n+    // Pods.\n+    Resources v1.ResourceList\n+}\n+\n+// PodGroupStatus represents the current state of a pod group.\n+type PodGroupStatus struct {\n+    // The number of actively running pods.\n+    // +optional\n+    Running int32\n+\n+    // The number of pods which reached phase Succeeded.\n+    // +optional\n+    Succeeded int32\n+\n+    // The number of pods which reached phase Failed.\n+    // +optional\n+    Failed int32\n+}\n+```\n+\n+The `PodGroup`, which is a namespaced object, specifies the behavior and status of a pod group, e.g. number of pods in a group. To define which pods are member of `PodGroup`, the following annotation key is introduced for `Pod`.\n+\n+```go\n+scheduling.k8s.io/group-name\n+```\n+\n+The `scheduling.k8s.io/group-name` annotation specifies the `PodGroup` that it belongs to; and the pod can only belong to the `PodGroup` in the same namespace. The pod, controlled by different collections, can also belong to the same `PodGroup`.  Because of performance concern,  it does not use `LabelSelector` to build the relationship between `PodGroup` and `Pod`.\n+\n+### Lifecycle Management\n+\n+As the lifecycle of Pods in PodGroup maybe different from controller to controller, the lifecycle management is delegated to the owner of Pods. In kube-arbitrator, it'll record related events for controller to manage pods, e.g. `Unschedulable`.\n+\n+The update to `PodGroup` is not support for now; and deleting `PodGroup` does not impact Pod's status.","path":"contributors/design-proposals/scheduling/coscheduling.md","position":116,"original_position":110,"commit_id":"961c4c8f720d3c73c73160233f0f7a6188a8a586","original_commit_id":"ed21d8035f70acabd58cbb9dbbfc24309af5d28f","user":{"login":"vishh","id":7063592,"node_id":"MDQ6VXNlcjcwNjM1OTI=","avatar_url":"https://avatars2.githubusercontent.com/u/7063592?v=4","gravatar_id":"","url":"https://api.github.com/users/vishh","html_url":"https://github.com/vishh","followers_url":"https://api.github.com/users/vishh/followers","following_url":"https://api.github.com/users/vishh/following{/other_user}","gists_url":"https://api.github.com/users/vishh/gists{/gist_id}","starred_url":"https://api.github.com/users/vishh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vishh/subscriptions","organizations_url":"https://api.github.com/users/vishh/orgs","repos_url":"https://api.github.com/users/vishh/repos","events_url":"https://api.github.com/users/vishh/events{/privacy}","received_events_url":"https://api.github.com/users/vishh/received_events","type":"User","site_admin":false},"body":"> Did not introduce phase for PodGroup right now\r\n\r\nHow will we differentiate between a PodGroup that's pending and one that's been admitted? When is it ok to GC pod groups? ","created_at":"2018-10-11T19:16:46Z","updated_at":"2018-10-11T19:16:46Z","html_url":"https://github.com/kubernetes/community/pull/2337#discussion_r224571922","pull_request_url":"https://api.github.com/repos/kubernetes/community/pulls/2337","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/community/pulls/comments/224571922"},"html":{"href":"https://github.com/kubernetes/community/pull/2337#discussion_r224571922"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/community/pulls/2337"}},"in_reply_to_id":218548925},"pull_request":{"url":"https://api.github.com/repos/kubernetes/community/pulls/2337","id":198830756,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4ODMwNzU2","html_url":"https://github.com/kubernetes/community/pull/2337","diff_url":"https://github.com/kubernetes/community/pull/2337.diff","patch_url":"https://github.com/kubernetes/community/pull/2337.patch","issue_url":"https://api.github.com/repos/kubernetes/community/issues/2337","number":2337,"state":"open","locked":false,"title":"KEP: Coscheduling","user":{"login":"k82cn","id":18107181,"node_id":"MDQ6VXNlcjE4MTA3MTgx","avatar_url":"https://avatars0.githubusercontent.com/u/18107181?v=4","gravatar_id":"","url":"https://api.github.com/users/k82cn","html_url":"https://github.com/k82cn","followers_url":"https://api.github.com/users/k82cn/followers","following_url":"https://api.github.com/users/k82cn/following{/other_user}","gists_url":"https://api.github.com/users/k82cn/gists{/gist_id}","starred_url":"https://api.github.com/users/k82cn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k82cn/subscriptions","organizations_url":"https://api.github.com/users/k82cn/orgs","repos_url":"https://api.github.com/users/k82cn/repos","events_url":"https://api.github.com/users/k82cn/events{/privacy}","received_events_url":"https://api.github.com/users/k82cn/received_events","type":"User","site_admin":false},"body":"Signed-off-by: Da K. Ma <klaus1982.cn@gmail.com>\r\n\r\n/cc @vishh, @bsalamat, @mindprince, @jlewi \r\n\r\n/cc @kubernetes/sig-scheduling-feature-requests ","created_at":"2018-07-03T02:00:13Z","updated_at":"2018-10-11T19:16:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"81c023de7c4bfc5f4056c29ab08f52af63e1e875","assignee":null,"assignees":[],"requested_reviewers":[{"login":"michelleN","id":1497123,"node_id":"MDQ6VXNlcjE0OTcxMjM=","avatar_url":"https://avatars0.githubusercontent.com/u/1497123?v=4","gravatar_id":"","url":"https://api.github.com/users/michelleN","html_url":"https://github.com/michelleN","followers_url":"https://api.github.com/users/michelleN/followers","following_url":"https://api.github.com/users/michelleN/following{/other_user}","gists_url":"https://api.github.com/users/michelleN/gists{/gist_id}","starred_url":"https://api.github.com/users/michelleN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michelleN/subscriptions","organizations_url":"https://api.github.com/users/michelleN/orgs","repos_url":"https://api.github.com/users/michelleN/repos","events_url":"https://api.github.com/users/michelleN/events{/privacy}","received_events_url":"https://api.github.com/users/michelleN/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":486032367,"node_id":"MDU6TGFiZWw0ODYwMzIzNjc=","url":"https://api.github.com/repos/kubernetes/community/labels/cncf-cla:%20yes","name":"cncf-cla: yes","color":"bfe5bf","default":false},{"id":653942785,"node_id":"MDU6TGFiZWw2NTM5NDI3ODU=","url":"https://api.github.com/repos/kubernetes/community/labels/kind/design","name":"kind/design","color":"c7def8","default":false},{"id":653942863,"node_id":"MDU6TGFiZWw2NTM5NDI4NjM=","url":"https://api.github.com/repos/kubernetes/community/labels/sig/architecture","name":"sig/architecture","color":"d2b48c","default":false},{"id":653942904,"node_id":"MDU6TGFiZWw2NTM5NDI5MDQ=","url":"https://api.github.com/repos/kubernetes/community/labels/sig/scheduling","name":"sig/scheduling","color":"d2b48c","default":false},{"id":653942910,"node_id":"MDU6TGFiZWw2NTM5NDI5MTA=","url":"https://api.github.com/repos/kubernetes/community/labels/size/L","name":"size/L","color":"ee9900","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/community/pulls/2337/commits","review_comments_url":"https://api.github.com/repos/kubernetes/community/pulls/2337/comments","review_comment_url":"https://api.github.com/repos/kubernetes/community/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/community/issues/2337/comments","statuses_url":"https://api.github.com/repos/kubernetes/community/statuses/961c4c8f720d3c73c73160233f0f7a6188a8a586","head":{"label":"k82cn:kep_583","ref":"kep_583","sha":"961c4c8f720d3c73c73160233f0f7a6188a8a586","user":{"login":"k82cn","id":18107181,"node_id":"MDQ6VXNlcjE4MTA3MTgx","avatar_url":"https://avatars0.githubusercontent.com/u/18107181?v=4","gravatar_id":"","url":"https://api.github.com/users/k82cn","html_url":"https://github.com/k82cn","followers_url":"https://api.github.com/users/k82cn/followers","following_url":"https://api.github.com/users/k82cn/following{/other_user}","gists_url":"https://api.github.com/users/k82cn/gists{/gist_id}","starred_url":"https://api.github.com/users/k82cn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k82cn/subscriptions","organizations_url":"https://api.github.com/users/k82cn/orgs","repos_url":"https://api.github.com/users/k82cn/repos","events_url":"https://api.github.com/users/k82cn/events{/privacy}","received_events_url":"https://api.github.com/users/k82cn/received_events","type":"User","site_admin":false},"repo":{"id":76308129,"node_id":"MDEwOlJlcG9zaXRvcnk3NjMwODEyOQ==","name":"community","full_name":"k82cn/community","private":false,"owner":{"login":"k82cn","id":18107181,"node_id":"MDQ6VXNlcjE4MTA3MTgx","avatar_url":"https://avatars0.githubusercontent.com/u/18107181?v=4","gravatar_id":"","url":"https://api.github.com/users/k82cn","html_url":"https://github.com/k82cn","followers_url":"https://api.github.com/users/k82cn/followers","following_url":"https://api.github.com/users/k82cn/following{/other_user}","gists_url":"https://api.github.com/users/k82cn/gists{/gist_id}","starred_url":"https://api.github.com/users/k82cn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k82cn/subscriptions","organizations_url":"https://api.github.com/users/k82cn/orgs","repos_url":"https://api.github.com/users/k82cn/repos","events_url":"https://api.github.com/users/k82cn/events{/privacy}","received_events_url":"https://api.github.com/users/k82cn/received_events","type":"User","site_admin":false},"html_url":"https://github.com/k82cn/community","description":"Kubernetes community content","fork":true,"url":"https://api.github.com/repos/k82cn/community","forks_url":"https://api.github.com/repos/k82cn/community/forks","keys_url":"https://api.github.com/repos/k82cn/community/keys{/key_id}","collaborators_url":"https://api.github.com/repos/k82cn/community/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/k82cn/community/teams","hooks_url":"https://api.github.com/repos/k82cn/community/hooks","issue_events_url":"https://api.github.com/repos/k82cn/community/issues/events{/number}","events_url":"https://api.github.com/repos/k82cn/community/events","assignees_url":"https://api.github.com/repos/k82cn/community/assignees{/user}","branches_url":"https://api.github.com/repos/k82cn/community/branches{/branch}","tags_url":"https://api.github.com/repos/k82cn/community/tags","blobs_url":"https://api.github.com/repos/k82cn/community/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/k82cn/community/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/k82cn/community/git/refs{/sha}","trees_url":"https://api.github.com/repos/k82cn/community/git/trees{/sha}","statuses_url":"https://api.github.com/repos/k82cn/community/statuses/{sha}","languages_url":"https://api.github.com/repos/k82cn/community/languages","stargazers_url":"https://api.github.com/repos/k82cn/community/stargazers","contributors_url":"https://api.github.com/repos/k82cn/community/contributors","subscribers_url":"https://api.github.com/repos/k82cn/community/subscribers","subscription_url":"https://api.github.com/repos/k82cn/community/subscription","commits_url":"https://api.github.com/repos/k82cn/community/commits{/sha}","git_commits_url":"https://api.github.com/repos/k82cn/community/git/commits{/sha}","comments_url":"https://api.github.com/repos/k82cn/community/comments{/number}","issue_comment_url":"https://api.github.com/repos/k82cn/community/issues/comments{/number}","contents_url":"https://api.github.com/repos/k82cn/community/contents/{+path}","compare_url":"https://api.github.com/repos/k82cn/community/compare/{base}...{head}","merges_url":"https://api.github.com/repos/k82cn/community/merges","archive_url":"https://api.github.com/repos/k82cn/community/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/k82cn/community/downloads","issues_url":"https://api.github.com/repos/k82cn/community/issues{/number}","pulls_url":"https://api.github.com/repos/k82cn/community/pulls{/number}","milestones_url":"https://api.github.com/repos/k82cn/community/milestones{/number}","notifications_url":"https://api.github.com/repos/k82cn/community/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/k82cn/community/labels{/name}","releases_url":"https://api.github.com/repos/k82cn/community/releases{/id}","deployments_url":"https://api.github.com/repos/k82cn/community/deployments","created_at":"2016-12-13T00:38:19Z","updated_at":"2018-08-31T03:24:46Z","pushed_at":"2018-09-30T11:55:30Z","git_url":"git://github.com/k82cn/community.git","ssh_url":"git@github.com:k82cn/community.git","clone_url":"https://github.com/k82cn/community.git","svn_url":"https://github.com/k82cn/community","homepage":"","size":31457,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"9343192b81b9179d1a06865a71c5addd0abdded5","user":{"login":"kubernetes","id":13629408,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjI5NDA4","avatar_url":"https://avatars2.githubusercontent.com/u/13629408?v=4","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":57939112,"node_id":"MDEwOlJlcG9zaXRvcnk1NzkzOTExMg==","name":"community","full_name":"kubernetes/community","private":false,"owner":{"login":"kubernetes","id":13629408,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjI5NDA4","avatar_url":"https://avatars2.githubusercontent.com/u/13629408?v=4","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},"html_url":"https://github.com/kubernetes/community","description":"Kubernetes community content","fork":false,"url":"https://api.github.com/repos/kubernetes/community","forks_url":"https://api.github.com/repos/kubernetes/community/forks","keys_url":"https://api.github.com/repos/kubernetes/community/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/community/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/community/teams","hooks_url":"https://api.github.com/repos/kubernetes/community/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/community/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/community/events","assignees_url":"https://api.github.com/repos/kubernetes/community/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/community/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/community/tags","blobs_url":"https://api.github.com/repos/kubernetes/community/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/community/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/community/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/community/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/community/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/community/languages","stargazers_url":"https://api.github.com/repos/kubernetes/community/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/community/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/community/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/community/subscription","commits_url":"https://api.github.com/repos/kubernetes/community/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/community/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/community/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/community/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/community/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/community/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/community/merges","archive_url":"https://api.github.com/repos/kubernetes/community/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/community/downloads","issues_url":"https://api.github.com/repos/kubernetes/community/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/community/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/community/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/community/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/community/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/community/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/community/deployments","created_at":"2016-05-03T03:36:05Z","updated_at":"2018-10-11T19:02:57Z","pushed_at":"2018-10-11T19:02:34Z","git_url":"git://github.com/kubernetes/community.git","ssh_url":"git@github.com:kubernetes/community.git","clone_url":"https://github.com/kubernetes/community.git","svn_url":"https://github.com/kubernetes/community","homepage":"","size":32651,"stargazers_count":2592,"watchers_count":2592,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1505,"mirror_url":null,"archived":false,"open_issues_count":233,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1505,"open_issues":233,"watchers":2592,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/community/pulls/2337"},"html":{"href":"https://github.com/kubernetes/community/pull/2337"},"issue":{"href":"https://api.github.com/repos/kubernetes/community/issues/2337"},"comments":{"href":"https://api.github.com/repos/kubernetes/community/issues/2337/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/community/pulls/2337/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/community/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/community/pulls/2337/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/community/statuses/961c4c8f720d3c73c73160233f0f7a6188a8a586"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"vishh"}}