{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/47462506","id":47462506,"diff_hunk":"@@ -0,0 +1,149 @@\n+<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->\n+\n+<!-- BEGIN STRIP_FOR_RELEASE -->\n+\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+\n+<h2>PLEASE NOTE: This document applies to the HEAD of the source tree</h2>\n+\n+If you are using a released version of Kubernetes, you should\n+refer to the docs that go with that version.\n+\n+<strong>\n+The latest release of this document can be found\n+[here](http://releases.k8s.io/release-1.1/docs/proposals/choosing-scheduler.md).\n+\n+Documentation for other releases can be found at\n+[releases.k8s.io](http://releases.k8s.io).\n+</strong>\n+--\n+\n+<!-- END STRIP_FOR_RELEASE -->\n+\n+<!-- END MUNGE: UNVERSIONED_WARNING -->\n+\n+# PodPolicy and its use in choosing the scheduler in a multi-scheduler system\n+\n+## Introduction\n+\n+This document describes a new API resource, `PodPolicy`, for defining policies that apply to pods\n+based on the pods' characteristics. Its initial use is to serve as the configuration for a\n+new admission controller that will assign the scheduler name annotation in a\n+[multi-scheduler](multiple-schedulers.md) Kubernetes system.\n+\n+## API\n+\n+```go\n+// PodPolicySpec defines the configuration of the PodPolicy API resource.\n+// Each rule is tested in order, and the first one that matches is applied.\n+// To specify a default policy, make the last rule have a PolicyPredicate containing\n+// an empty PodSelector (matches all pods in the namespace).\n+type PodPolicySpec struct {\n+\t// A list of rules that define the policy. Each rule is tested in order, and the first one\n+\t// that matches is applied. \n+\tRules []PodPolicyRule `json:\"rules,omitempty\"`\n+}\n+\n+// If the PolicyPredicate is met, then all of the actions specified\n+// by the remaining fields are applied. \n+type PodPolicyRule struct {\n+\tPolicyPredicate *PolicyPredicate `json:\"policyPredicate,omitempty\"`\n+\t// Add the specified annotations to the pod.\n+\tAnnotations map[string]string  `json:annotations,omitempty`\n+\t// In the future, we will add more actions here.\n+}\n+\n+// QoS describes the Quality of Service class of a pod. Kubelet defines QoS on a\n+// per-container, per-resource basis, but here we need to match a single QoS per pod.\n+// We assume the consumer of PodPolicy will compute the per-pod QoS as the max QoS\n+// across all resources and containers in the pod.\n+type QoS string\n+\n+const (\n+\tQoSGuaranteed QoS = \"Guaranteed\"\n+\tQoSBurstable  QoS = \"Burstable\"\n+\tQoSBestEffort QoS = \"BestEffort\"\n+)\n+\n+// All criteria must be met for the PolicyPredicate to be considered met.\n+type PolicyPredicate struct {\n+\t// Note that Namespace is not listed here because PodPolicy is per-Namespace.\n+\tPodSelector *PodSelector `json:\"podSelector,omitempty\"`\n+\tQoS QoS  `json:qos,omitempty`\n+}\n+\n+// PodPolicy describes the PodPolicy API resource, which is used for specifying\n+// policies that should be applied to pods based on the pods' characteristics.\n+type PodPolicy struct {\n+\tunversioned.TypeMeta `json:\",inline\"`\n+\t// Standard object's metadata.\n+\t// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata\n+\tObjectMeta `json:\"metadata,omitempty\"`\n+\n+\t// Spec defines the pod scheduler policy implemented by this admission controller.\n+\t// http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status\n+\tSpec PodPolicySpec `json:\"spec,omitempty\"`\n+}\n+\n+// PodPolicyList is a list of PodPolicy items.\n+type PodPolicyList struct {\n+\tunversioned.TypeMeta `json:\",inline\"`\n+\t// Standard list metadata.\n+\t// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds\n+\tunversioned.ListMeta `json:\"metadata,omitempty\"`\n+\n+\t// Items is a list of PodPolicy objects.\n+\t// More info: http://releases.k8s.io/HEAD/docs/design/admission_control_resource_quota.md#admissioncontrol-plugin-resourcequota\n+\tItems []PodPolicy `json:\"items\"`\n+}\n+```\n+\n+## Implementation plan\n+\n+1. Create `PodPolicy` API resource\n+1. Create admission controller that uses policy defined in `PodPolicy` to set scheduler name annotation\n+\n+*TODO*: What are the semantics of having multiple `PodPolicy` API resources? \"Apply all of them\" is not\n+ideal since there is an ordering to the rules within one. We could do \"apply all of them in\n+alphabetical order\" or something like that...\n+\n+*TODO*: Is there a way to specify a singleton `PodPolicy` that would apply across all namespaces?","path":"docs/proposals/podpolicy.md","position":119,"original_position":119,"commit_id":"26b2c0abcf539622a98368d7c60d98a1695f61ec","original_commit_id":"26b2c0abcf539622a98368d7c60d98a1695f61ec","user":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"body":"We rejected (in Openshift) \"special by namespace\" multiple times.\nBimodal resources was a disaster every time we tried it - we instead\nsettled on different resources (clusterpolicy vs policy, etc).  At a\nminimum, it keeps access control, API docs, paths, and concepts\nseparated.\n\nI'd say there's too much infrastructure in place to easily change it\nright now, and special namespace violates all the other assumptions we\nhave in place (and makes policy harder). You could easily bog down for\ntwo months trying to get over the hump for multi-scope resources -\nDerek, David, and I have all wasted lots of time on that path.  I'd\nsay for now two separate types is the best path, prove whatever\nconcepts you need, then decide whether unification is worth it.\n\n> Should we consider a mechanism for some resources to be namespaced AND global? Or maybe some pattern of 2 resources that share the same schema but differ only in scope? I think this is going to keep coming up for policy-related stuff, and modelling it as \"a special-by-convention namespace\" is obtuse at best.\n","created_at":"2015-12-14T05:27:17Z","updated_at":"2015-12-14T05:27:17Z","html_url":"https://github.com/kubernetes/kubernetes/pull/18262#discussion_r47462506","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18262","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/47462506"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/18262#discussion_r47462506"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18262"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18262","id":52793055,"html_url":"https://github.com/kubernetes/kubernetes/pull/18262","diff_url":"https://github.com/kubernetes/kubernetes/pull/18262.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/18262.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/18262","number":18262,"state":"open","locked":false,"title":"PodPolicy and its use in choosing the scheduler in multi-scheduler Kubernetes system","user":{"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},"body":"ref/ #11793\r\nref/ #17097 \r\nref/ #17324\r\n\r\n@thockin @HaiyangDING @bgrant0607 @cameronbrunner @timothysc @hongchaodeng @mali11 @mqliang @derekwaynecarr \r\n","created_at":"2015-12-06T22:47:12Z","updated_at":"2015-12-14T05:27:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"204dc2bf55f6e29c361f9cda9531577fdbb04e8e","assignee":{"login":"bgrant0607","id":7725777,"avatar_url":"https://avatars.githubusercontent.com/u/7725777?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrant0607","html_url":"https://github.com/bgrant0607","followers_url":"https://api.github.com/users/bgrant0607/followers","following_url":"https://api.github.com/users/bgrant0607/following{/other_user}","gists_url":"https://api.github.com/users/bgrant0607/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrant0607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrant0607/subscriptions","organizations_url":"https://api.github.com/users/bgrant0607/orgs","repos_url":"https://api.github.com/users/bgrant0607/repos","events_url":"https://api.github.com/users/bgrant0607/events{/privacy}","received_events_url":"https://api.github.com/users/bgrant0607/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18262/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18262/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/18262/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/26b2c0abcf539622a98368d7c60d98a1695f61ec","head":{"label":"davidopp:choose-scheduler","ref":"choose-scheduler","sha":"26b2c0abcf539622a98368d7c60d98a1695f61ec","user":{"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},"repo":{"id":42850455,"name":"kubernetes","full_name":"davidopp/kubernetes","owner":{"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},"private":false,"html_url":"https://github.com/davidopp/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/davidopp/kubernetes","forks_url":"https://api.github.com/repos/davidopp/kubernetes/forks","keys_url":"https://api.github.com/repos/davidopp/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davidopp/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davidopp/kubernetes/teams","hooks_url":"https://api.github.com/repos/davidopp/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/davidopp/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/davidopp/kubernetes/events","assignees_url":"https://api.github.com/repos/davidopp/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/davidopp/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/davidopp/kubernetes/tags","blobs_url":"https://api.github.com/repos/davidopp/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davidopp/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davidopp/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/davidopp/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davidopp/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/davidopp/kubernetes/languages","stargazers_url":"https://api.github.com/repos/davidopp/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/davidopp/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/davidopp/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/davidopp/kubernetes/subscription","commits_url":"https://api.github.com/repos/davidopp/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/davidopp/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/davidopp/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/davidopp/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/davidopp/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/davidopp/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davidopp/kubernetes/merges","archive_url":"https://api.github.com/repos/davidopp/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davidopp/kubernetes/downloads","issues_url":"https://api.github.com/repos/davidopp/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/davidopp/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/davidopp/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/davidopp/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davidopp/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/davidopp/kubernetes/releases{/id}","created_at":"2015-09-21T07:23:57Z","updated_at":"2015-09-21T07:24:06Z","pushed_at":"2015-12-08T07:49:05Z","git_url":"git://github.com/davidopp/kubernetes.git","ssh_url":"git@github.com:davidopp/kubernetes.git","clone_url":"https://github.com/davidopp/kubernetes.git","svn_url":"https://github.com/davidopp/kubernetes","homepage":"http://kubernetes.io","size":144516,"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":"810181fb7b4e969d1c1aa84f32377ef1b65f8c65","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-12-14T04:13:44Z","pushed_at":"2015-12-14T05:23:30Z","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":292038,"stargazers_count":11742,"watchers_count":11742,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3198,"mirror_url":null,"open_issues_count":2579,"forks":3198,"open_issues":2579,"watchers":11742,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18262"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/18262"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/18262"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/18262/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18262/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18262/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/26b2c0abcf539622a98368d7c60d98a1695f61ec"}}}}