{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/community/pulls/comments/117317356","pull_request_review_id":39016041,"id":117317356,"diff_hunk":"@@ -0,0 +1,237 @@\n+# Priority in Kubernetes API\n+\n+@bsalamat\n+\n+May 2017\n+  * [Objective](#objective)\n+    * [Non-Goals](#oon-Goals)\n+  * [Background](#background)\n+  * [Overview](#overview)\n+  * [Detailed Design](#detailed-design)\n+    * [Effect of priority on scheduling](#effect-of-priority-on-scheduling)\n+    * [Effect of priority on preemption](#effect-of-priority-on-preemption)\n+    * [Priority in PodSpec](#priority-in-podspec)\n+    * [Priority Classes](#priority-classes)\n+    * [Resolving priority class names](#resolving-priority-class-names)\n+    * [Ordering of priorities](#ordering-of-priorities)\n+    * [system PriorityClassName](#system-priorityclassname)\n+    * [Modifying Priority Classes](#modifying-priority-classes)\n+    * [Drawbacks of changing priority names](#drawbacks-of-changing-priority-names)\n+    * [Priority and QoS classes](#priority-and-qos-classes)\n+\n+\n+## Objective\n+\n+\n+\n+*   How to specify priority for workloads in Kubernetes API.\n+*   Define how the order of these priorities are specified. \n+*   Define how new priority levels are added.\n+*   Effect of priority on scheduling and preemption.\n+\n+### Non-Goals \n+\n+\n+\n+*   How preemption works in Kubernetes.\n+*   How quota allocation and accounting works for each priority.\n+\n+## Background \n+\n+It is fairly common in clusters to have more tasks than what the cluster\n+resources can handle. Often times the workload is a mix of high priority\n+critical tasks, and non-urgent tasks that can wait. Cluster management should be\n+able to distinguish these workloads in order to decide which ones should acquire\n+the resources sooner and which ones can wait. Priority of the workload is one of\n+the key metrics that provides the information to the cluster. This document is a\n+more detailed design proposal for part of the high-level architecture described\n+in [Resource sharing architecture for batch and serving workloads in Kubernetes](https://docs.google.com/document/d/1-H2hnZap7gQivcSU-9j4ZrJ8wE_WwcfOkTeAGjzUyLA).\n+\n+## Overview \n+\n+This design doc introduces the concept of priorities for pods in Kubernetes and\n+how the priority impacts scheduling and preemption of pods when the cluster\n+runs out of resources. A pod can specify a priority at the creation time. The\n+priority must be one of the valid values and there is a total order on the\n+values. The priority of a pod is independent of its workload type. The priority\n+is global and not specific to a particular namespace.\n+\n+## Detailed Design \n+\n+### Effect of priority on scheduling \n+\n+One could generally expect a pod with higher priority has a higher chance of\n+getting scheduled than the same pod with lower priority. However, there are\n+many other parameters that affect scheduling decisions. So, a high priority pod\n+may or may not be scheduled before lower priority pods. The details of\n+what determines the order at which pods are scheduled are beyond the scope of\n+this document.\n+\n+### Effect of priority on preemption \n+\n+Generally, lower priority pods are more likely to get preempted by higher\n+priority pods when cluster has reached a threshold. In such a case, scheduler\n+may decide to preempt lower priority pods to release enough resources for higher\n+priority pending pods. As mentioned before, there are many other parameters\n+that affect scheduling decisions, such as affinity and anti-affinity. If\n+scheduler determines that a high priority pod cannot be scheduled even if lower\n+priority pods are preempted, it will not preempt lower priority pods. Scheduler\n+may have other restrictions on preempting pods, for example, it may refuse to\n+preempt a pod if PodDisruptionBudget is violated. The details of scheduling and\n+preemption decisions are beyond the scope of this document.\n+\n+### Priority in PodSpec \n+\n+Pods may have priority in their pod spec. PodSpec will have two new fields\n+called \"PriorityClassName\" which is specified by user, and \"Priority\" which will\n+be populated by Kubernetes. User-specified priority (PriorityClassName) is a \n+string and all of the valid priority classes are defined by a system wide\n+mapping that maps each string to an integer. The PriorityClassName specified in\n+a pod spec must be found in this map or the pod creation request will be\n+rejected. If PriorityClassName is empty, it will resolve to the default\n+priority (See below for more info on name resolution). Once the \n+PriorityClassName is resolved to an integer, it is placed in \"Priority\" field of\n+PodSpec.\n+\n+\n+```\n+type PodSpec struct {\n+  ...\n+  PriorityClassName string\n+  Priority          int32  // Populated by Admission Controller. Users are not allowed to set it directly.\n+}\n+```\n+\n+### Priority Classes \n+\n+A Kubernetes cluster has one predefined (built-in) priority class which is ","path":"contributors/design-proposals/pod-priority-api.md","position":107,"original_position":107,"commit_id":"d32386ebeedeb0f1767e1151ed957b9494d81215","original_commit_id":"d32386ebeedeb0f1767e1151ed957b9494d81215","user":{"login":"erictune","id":8105590,"avatar_url":"https://avatars0.githubusercontent.com/u/8105590?v=3","gravatar_id":"","url":"https://api.github.com/users/erictune","html_url":"https://github.com/erictune","followers_url":"https://api.github.com/users/erictune/followers","following_url":"https://api.github.com/users/erictune/following{/other_user}","gists_url":"https://api.github.com/users/erictune/gists{/gist_id}","starred_url":"https://api.github.com/users/erictune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erictune/subscriptions","organizations_url":"https://api.github.com/users/erictune/orgs","repos_url":"https://api.github.com/users/erictune/repos","events_url":"https://api.github.com/users/erictune/events{/privacy}","received_events_url":"https://api.github.com/users/erictune/received_events","type":"User","site_admin":false},"body":"Can we have multiple ones that ship by default, or at least which can be installed with a single command (e.g. `kubectl apply -f http://kubernetes.io/default-prio-classes.yaml`)\r\n\r\n Most users aren't going to write their own, they just want something that works, and they won't use it the way we intend if we don't provide something.  \r\n\r\nAlso, documentation and stuff can't really explain the feature succinctly without multiple default levels.","created_at":"2017-05-18T18:15:51Z","updated_at":"2017-05-18T18:15:51Z","html_url":"https://github.com/kubernetes/community/pull/604#discussion_r117317356","pull_request_url":"https://api.github.com/repos/kubernetes/community/pulls/604","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/community/pulls/comments/117317356"},"html":{"href":"https://github.com/kubernetes/community/pull/604#discussion_r117317356"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/community/pulls/604"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/community/pulls/604","id":119260047,"html_url":"https://github.com/kubernetes/community/pull/604","diff_url":"https://github.com/kubernetes/community/pull/604.diff","patch_url":"https://github.com/kubernetes/community/pull/604.patch","issue_url":"https://api.github.com/repos/kubernetes/community/issues/604","number":604,"state":"open","locked":false,"title":"Design proposal for adding priority to Kubernetes API","user":{"login":"bsalamat","id":14308438,"avatar_url":"https://avatars0.githubusercontent.com/u/14308438?v=3","gravatar_id":"","url":"https://api.github.com/users/bsalamat","html_url":"https://github.com/bsalamat","followers_url":"https://api.github.com/users/bsalamat/followers","following_url":"https://api.github.com/users/bsalamat/following{/other_user}","gists_url":"https://api.github.com/users/bsalamat/gists{/gist_id}","starred_url":"https://api.github.com/users/bsalamat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsalamat/subscriptions","organizations_url":"https://api.github.com/users/bsalamat/orgs","repos_url":"https://api.github.com/users/bsalamat/repos","events_url":"https://api.github.com/users/bsalamat/events{/privacy}","received_events_url":"https://api.github.com/users/bsalamat/received_events","type":"User","site_admin":false},"body":"@kubernetes/sig-scheduling-api-reviews \r\n@kubernetes/api-reviewers ","created_at":"2017-05-05T21:15:20Z","updated_at":"2017-05-18T18:15:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f7ccb35e9d33d03fdb34eafbb018eb16a18f4c1","assignee":{"login":"derekwaynecarr","id":6233452,"avatar_url":"https://avatars0.githubusercontent.com/u/6233452?v=3","gravatar_id":"","url":"https://api.github.com/users/derekwaynecarr","html_url":"https://github.com/derekwaynecarr","followers_url":"https://api.github.com/users/derekwaynecarr/followers","following_url":"https://api.github.com/users/derekwaynecarr/following{/other_user}","gists_url":"https://api.github.com/users/derekwaynecarr/gists{/gist_id}","starred_url":"https://api.github.com/users/derekwaynecarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekwaynecarr/subscriptions","organizations_url":"https://api.github.com/users/derekwaynecarr/orgs","repos_url":"https://api.github.com/users/derekwaynecarr/repos","events_url":"https://api.github.com/users/derekwaynecarr/events{/privacy}","received_events_url":"https://api.github.com/users/derekwaynecarr/received_events","type":"User","site_admin":false},"assignees":[{"login":"derekwaynecarr","id":6233452,"avatar_url":"https://avatars0.githubusercontent.com/u/6233452?v=3","gravatar_id":"","url":"https://api.github.com/users/derekwaynecarr","html_url":"https://github.com/derekwaynecarr","followers_url":"https://api.github.com/users/derekwaynecarr/followers","following_url":"https://api.github.com/users/derekwaynecarr/following{/other_user}","gists_url":"https://api.github.com/users/derekwaynecarr/gists{/gist_id}","starred_url":"https://api.github.com/users/derekwaynecarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekwaynecarr/subscriptions","organizations_url":"https://api.github.com/users/derekwaynecarr/orgs","repos_url":"https://api.github.com/users/derekwaynecarr/repos","events_url":"https://api.github.com/users/derekwaynecarr/events{/privacy}","received_events_url":"https://api.github.com/users/derekwaynecarr/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/community/pulls/604/commits","review_comments_url":"https://api.github.com/repos/kubernetes/community/pulls/604/comments","review_comment_url":"https://api.github.com/repos/kubernetes/community/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/community/issues/604/comments","statuses_url":"https://api.github.com/repos/kubernetes/community/statuses/d32386ebeedeb0f1767e1151ed957b9494d81215","head":{"label":"bsalamat:priority_api","ref":"priority_api","sha":"d32386ebeedeb0f1767e1151ed957b9494d81215","user":{"login":"bsalamat","id":14308438,"avatar_url":"https://avatars0.githubusercontent.com/u/14308438?v=3","gravatar_id":"","url":"https://api.github.com/users/bsalamat","html_url":"https://github.com/bsalamat","followers_url":"https://api.github.com/users/bsalamat/followers","following_url":"https://api.github.com/users/bsalamat/following{/other_user}","gists_url":"https://api.github.com/users/bsalamat/gists{/gist_id}","starred_url":"https://api.github.com/users/bsalamat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsalamat/subscriptions","organizations_url":"https://api.github.com/users/bsalamat/orgs","repos_url":"https://api.github.com/users/bsalamat/repos","events_url":"https://api.github.com/users/bsalamat/events{/privacy}","received_events_url":"https://api.github.com/users/bsalamat/received_events","type":"User","site_admin":false},"repo":{"id":87964091,"name":"community","full_name":"bsalamat/community","owner":{"login":"bsalamat","id":14308438,"avatar_url":"https://avatars0.githubusercontent.com/u/14308438?v=3","gravatar_id":"","url":"https://api.github.com/users/bsalamat","html_url":"https://github.com/bsalamat","followers_url":"https://api.github.com/users/bsalamat/followers","following_url":"https://api.github.com/users/bsalamat/following{/other_user}","gists_url":"https://api.github.com/users/bsalamat/gists{/gist_id}","starred_url":"https://api.github.com/users/bsalamat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsalamat/subscriptions","organizations_url":"https://api.github.com/users/bsalamat/orgs","repos_url":"https://api.github.com/users/bsalamat/repos","events_url":"https://api.github.com/users/bsalamat/events{/privacy}","received_events_url":"https://api.github.com/users/bsalamat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bsalamat/community","description":"Kubernetes community content","fork":true,"url":"https://api.github.com/repos/bsalamat/community","forks_url":"https://api.github.com/repos/bsalamat/community/forks","keys_url":"https://api.github.com/repos/bsalamat/community/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bsalamat/community/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bsalamat/community/teams","hooks_url":"https://api.github.com/repos/bsalamat/community/hooks","issue_events_url":"https://api.github.com/repos/bsalamat/community/issues/events{/number}","events_url":"https://api.github.com/repos/bsalamat/community/events","assignees_url":"https://api.github.com/repos/bsalamat/community/assignees{/user}","branches_url":"https://api.github.com/repos/bsalamat/community/branches{/branch}","tags_url":"https://api.github.com/repos/bsalamat/community/tags","blobs_url":"https://api.github.com/repos/bsalamat/community/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bsalamat/community/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bsalamat/community/git/refs{/sha}","trees_url":"https://api.github.com/repos/bsalamat/community/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bsalamat/community/statuses/{sha}","languages_url":"https://api.github.com/repos/bsalamat/community/languages","stargazers_url":"https://api.github.com/repos/bsalamat/community/stargazers","contributors_url":"https://api.github.com/repos/bsalamat/community/contributors","subscribers_url":"https://api.github.com/repos/bsalamat/community/subscribers","subscription_url":"https://api.github.com/repos/bsalamat/community/subscription","commits_url":"https://api.github.com/repos/bsalamat/community/commits{/sha}","git_commits_url":"https://api.github.com/repos/bsalamat/community/git/commits{/sha}","comments_url":"https://api.github.com/repos/bsalamat/community/comments{/number}","issue_comment_url":"https://api.github.com/repos/bsalamat/community/issues/comments{/number}","contents_url":"https://api.github.com/repos/bsalamat/community/contents/{+path}","compare_url":"https://api.github.com/repos/bsalamat/community/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bsalamat/community/merges","archive_url":"https://api.github.com/repos/bsalamat/community/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bsalamat/community/downloads","issues_url":"https://api.github.com/repos/bsalamat/community/issues{/number}","pulls_url":"https://api.github.com/repos/bsalamat/community/pulls{/number}","milestones_url":"https://api.github.com/repos/bsalamat/community/milestones{/number}","notifications_url":"https://api.github.com/repos/bsalamat/community/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bsalamat/community/labels{/name}","releases_url":"https://api.github.com/repos/bsalamat/community/releases{/id}","deployments_url":"https://api.github.com/repos/bsalamat/community/deployments","created_at":"2017-04-11T17:59:20Z","updated_at":"2017-04-11T17:59:23Z","pushed_at":"2017-05-16T02:11:05Z","git_url":"git://github.com/bsalamat/community.git","ssh_url":"git@github.com:bsalamat/community.git","clone_url":"https://github.com/bsalamat/community.git","svn_url":"https://github.com/bsalamat/community","homepage":"","size":7777,"stargazers_count":0,"watchers_count":0,"language":"Makefile","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"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":"9cb632d41f93014b89bc5cdca0ed2575350c9fe7","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars1.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":57939112,"name":"community","full_name":"kubernetes/community","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars1.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/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":"2017-05-18T14:24:57Z","pushed_at":"2017-05-18T17:44:55Z","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":8348,"stargazers_count":432,"watchers_count":432,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":395,"mirror_url":null,"open_issues_count":136,"forks":395,"open_issues":136,"watchers":432,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/community/pulls/604"},"html":{"href":"https://github.com/kubernetes/community/pull/604"},"issue":{"href":"https://api.github.com/repos/kubernetes/community/issues/604"},"comments":{"href":"https://api.github.com/repos/kubernetes/community/issues/604/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/community/pulls/604/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/community/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/community/pulls/604/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/community/statuses/d32386ebeedeb0f1767e1151ed957b9494d81215"}}}}
{"actor":{"display_login":"erictune"}}