{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/41775572","id":41775572,"diff_hunk":"@@ -0,0 +1,324 @@\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 1.0.x release of this document can be found\n+[here](http://releases.k8s.io/release-1.0/docs/proposals/cluster-autoscaling.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+# Cluster Autoscaling\n+\n+## Preface\n+\n+This document briefly describes the design and roadmap of cluster autoscaling in Kubernetes.\n+\n+## Overview\n+\n+The purpose of Cluster Autoscaler is to adjust the size of the Kubernetes cluster to match\n+the current needs of the applications running inside of the cluster. In general, if cluster\n+nodes are under heavy load or there are pods that cannot be scheduled due to insufficient\n+free resources then more machines should be added to the cluster. In the similar way if the\n+machines are used only a little and it is apparent that the same set of pods could be run on\n+fewer nodes, then the size of the cluster should be reduced.\n+\n+## Kubernetes 1.1 - no Kubernetes-native cluster autoscaling\n+\n+In the current Kubernetes version we have a basic support for cluster autoscaling. It is based\n+on Google Cloud Autoscaler (https://cloud.google.com/compute/docs/autoscaler/) and works only\n+in Google Compute Engine. It looks at total cpu usage on the node (including system stuff) \n+and total cpu request of all running pods. It can also scale on memory but for the simplicity\n+this document will focus only on the CPU usage aspect (other metrics work in the exactly same way).\n+The user is expected to provide the target level of utilization and GCA will adjust the size to \n+meet the target. From the bird’s eye the architecture looks as below.\n+\n+```\n+                  +--MIG-----------------------------+\n+                  |                                  |\n+                  | +--------+ +--------+ +--------+ |\n+                  | |        | |        | |        | |\n+                  | | Node1  | | Node2  | | NodeX  | |\n+                  | |        | |        | |        | +<--+\n+                  | +--------+ +--------+ +--------+ |   |\n+                  | |cAdvisor| |cAdvisor| |cAdvisor| |   |\n+                  | +--------+ +--------+ +----+---+ |   |\n+                  |     |          |           |     |   |\n+                  +-----|----------|-----------|-----+   |\n+                        |          |           |         |\n+                        |      +---v----+      |         |\n+                        +----> |Heapster| <----+         |\n+                               +---+----+                |\n+                                   |                     |\n+   Kubernetes                      |                     |\n+-----------------------------------|---------------------|------\n+   Google                          |                     |\n+                                   |                     |\n+                            +------v-----+       +-------+------+\n+                            |Google Cloud|       |MIG Definition|\n+                            | Monitoring |       +-------^------+\n+                            +------------+               |\n+                                   |                     |\n+                                   |                     |\n+                            +------v-----+               |\n+                +------+    |Google Cloud+---------------+\n+                |Config|--->| Autoscaler |\n+                +------+    +------------+\n+```\n+\n+CAdvisor instances gather metrics for nodes they are running on. Periodically Heapster (a service running\n+on one of the nodes) queries all of the available nodes/cAdvisors, aggregates the metrics and pushes the\n+usage to Google Cloud Monitoring (Heapster also takes Pod requests from apiserver but this fact is not\n+depicted on the diagram). Google Cloud Autoscaler checks the metrics in GCM, compares the values\n+and min/max cluster sizes from the config (that is passed through google-specific gcloud tool or web ui,\n+and currently set up in kube-up/push) and updates the number of nodes in MIG (Managed Instance Group)\n+definition. MIG then starts (or stops) the nodes.\n+\n+\n+The current solution has a bunch of issues:\n+\n+* (I1) [GCE specific API] Autoscaler configuration is Google-specific thus on other cloud providers the configuration may look completely different.\n+* (I2) [GCE specific logic] Autoscaler logic (scale on a custom metric) is Google-specific - it might be hard to get it working on AWS or elsewhere\n+because their autoscaler either does not allow to use custom metric or interprets/acts differently.\n+* (I3) [Works well only for well formed pods] \n+Autoscaler grows the cluster only in reaction to resource consumption of pods that are already running, i.e. \n+it does not take into account pods that are pending. It still tends to increase the probability that \n+a pod will schedule, by keeping the cluster \"not too full\" (reasonable amount of free resources), but this is ","path":"docs/proposals/cluster-autoscaling.md","position":109,"original_position":109,"commit_id":"1624a47caeeac3a257b4e2919284e7fb0fcdaddc","original_commit_id":"1624a47caeeac3a257b4e2919284e7fb0fcdaddc","user":{"login":"mwielgus","id":11994812,"avatar_url":"https://avatars.githubusercontent.com/u/11994812?v=3","gravatar_id":"","url":"https://api.github.com/users/mwielgus","html_url":"https://github.com/mwielgus","followers_url":"https://api.github.com/users/mwielgus/followers","following_url":"https://api.github.com/users/mwielgus/following{/other_user}","gists_url":"https://api.github.com/users/mwielgus/gists{/gist_id}","starred_url":"https://api.github.com/users/mwielgus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwielgus/subscriptions","organizations_url":"https://api.github.com/users/mwielgus/orgs","repos_url":"https://api.github.com/users/mwielgus/repos","events_url":"https://api.github.com/users/mwielgus/events{/privacy}","received_events_url":"https://api.github.com/users/mwielgus/received_events","type":"User","site_admin":false},"body":"done","created_at":"2015-10-12T16:40:11Z","updated_at":"2015-10-12T16:40:11Z","html_url":"https://github.com/kubernetes/kubernetes/pull/15304#discussion_r41775572","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15304","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/41775572"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/15304#discussion_r41775572"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15304"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15304","id":47161894,"html_url":"https://github.com/kubernetes/kubernetes/pull/15304","diff_url":"https://github.com/kubernetes/kubernetes/pull/15304.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/15304.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/15304","number":15304,"state":"open","locked":false,"title":"Cluster autoscaling proposal","user":{"login":"mwielgus","id":11994812,"avatar_url":"https://avatars.githubusercontent.com/u/11994812?v=3","gravatar_id":"","url":"https://api.github.com/users/mwielgus","html_url":"https://github.com/mwielgus","followers_url":"https://api.github.com/users/mwielgus/followers","following_url":"https://api.github.com/users/mwielgus/following{/other_user}","gists_url":"https://api.github.com/users/mwielgus/gists{/gist_id}","starred_url":"https://api.github.com/users/mwielgus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwielgus/subscriptions","organizations_url":"https://api.github.com/users/mwielgus/orgs","repos_url":"https://api.github.com/users/mwielgus/repos","events_url":"https://api.github.com/users/mwielgus/events{/privacy}","received_events_url":"https://api.github.com/users/mwielgus/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-08T14:44:41Z","updated_at":"2015-10-12T16:40:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8af60a37eeb46b51e7f5f607a0054daa78b95560","assignee":{"login":"brendandburns","id":5751682,"avatar_url":"https://avatars.githubusercontent.com/u/5751682?v=3","gravatar_id":"","url":"https://api.github.com/users/brendandburns","html_url":"https://github.com/brendandburns","followers_url":"https://api.github.com/users/brendandburns/followers","following_url":"https://api.github.com/users/brendandburns/following{/other_user}","gists_url":"https://api.github.com/users/brendandburns/gists{/gist_id}","starred_url":"https://api.github.com/users/brendandburns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendandburns/subscriptions","organizations_url":"https://api.github.com/users/brendandburns/orgs","repos_url":"https://api.github.com/users/brendandburns/repos","events_url":"https://api.github.com/users/brendandburns/events{/privacy}","received_events_url":"https://api.github.com/users/brendandburns/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15304/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15304/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/15304/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/1624a47caeeac3a257b4e2919284e7fb0fcdaddc","head":{"label":"mwielgus:kac_proposal","ref":"kac_proposal","sha":"1624a47caeeac3a257b4e2919284e7fb0fcdaddc","user":{"login":"mwielgus","id":11994812,"avatar_url":"https://avatars.githubusercontent.com/u/11994812?v=3","gravatar_id":"","url":"https://api.github.com/users/mwielgus","html_url":"https://github.com/mwielgus","followers_url":"https://api.github.com/users/mwielgus/followers","following_url":"https://api.github.com/users/mwielgus/following{/other_user}","gists_url":"https://api.github.com/users/mwielgus/gists{/gist_id}","starred_url":"https://api.github.com/users/mwielgus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwielgus/subscriptions","organizations_url":"https://api.github.com/users/mwielgus/orgs","repos_url":"https://api.github.com/users/mwielgus/repos","events_url":"https://api.github.com/users/mwielgus/events{/privacy}","received_events_url":"https://api.github.com/users/mwielgus/received_events","type":"User","site_admin":false},"repo":{"id":34387979,"name":"kubernetes","full_name":"mwielgus/kubernetes","owner":{"login":"mwielgus","id":11994812,"avatar_url":"https://avatars.githubusercontent.com/u/11994812?v=3","gravatar_id":"","url":"https://api.github.com/users/mwielgus","html_url":"https://github.com/mwielgus","followers_url":"https://api.github.com/users/mwielgus/followers","following_url":"https://api.github.com/users/mwielgus/following{/other_user}","gists_url":"https://api.github.com/users/mwielgus/gists{/gist_id}","starred_url":"https://api.github.com/users/mwielgus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwielgus/subscriptions","organizations_url":"https://api.github.com/users/mwielgus/orgs","repos_url":"https://api.github.com/users/mwielgus/repos","events_url":"https://api.github.com/users/mwielgus/events{/privacy}","received_events_url":"https://api.github.com/users/mwielgus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mwielgus/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/mwielgus/kubernetes","forks_url":"https://api.github.com/repos/mwielgus/kubernetes/forks","keys_url":"https://api.github.com/repos/mwielgus/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mwielgus/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mwielgus/kubernetes/teams","hooks_url":"https://api.github.com/repos/mwielgus/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/mwielgus/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/mwielgus/kubernetes/events","assignees_url":"https://api.github.com/repos/mwielgus/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/mwielgus/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/mwielgus/kubernetes/tags","blobs_url":"https://api.github.com/repos/mwielgus/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mwielgus/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mwielgus/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/mwielgus/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mwielgus/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/mwielgus/kubernetes/languages","stargazers_url":"https://api.github.com/repos/mwielgus/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/mwielgus/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/mwielgus/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/mwielgus/kubernetes/subscription","commits_url":"https://api.github.com/repos/mwielgus/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/mwielgus/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/mwielgus/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/mwielgus/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/mwielgus/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/mwielgus/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mwielgus/kubernetes/merges","archive_url":"https://api.github.com/repos/mwielgus/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mwielgus/kubernetes/downloads","issues_url":"https://api.github.com/repos/mwielgus/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/mwielgus/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/mwielgus/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/mwielgus/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mwielgus/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/mwielgus/kubernetes/releases{/id}","created_at":"2015-04-22T12:04:42Z","updated_at":"2015-04-22T12:04:46Z","pushed_at":"2015-10-09T10:49:36Z","git_url":"git://github.com/mwielgus/kubernetes.git","ssh_url":"git@github.com:mwielgus/kubernetes.git","clone_url":"https://github.com/mwielgus/kubernetes.git","svn_url":"https://github.com/mwielgus/kubernetes","homepage":"http://kubernetes.io","size":112942,"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":"2a62468fee05242d69004c82b346db5c5ffc8a83","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-10-12T13:48:08Z","pushed_at":"2015-10-12T16:33:05Z","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":457401,"stargazers_count":10650,"watchers_count":10650,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2692,"mirror_url":null,"open_issues_count":2022,"forks":2692,"open_issues":2022,"watchers":10650,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15304"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/15304"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/15304"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/15304/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15304/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/15304/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/1624a47caeeac3a257b4e2919284e7fb0fcdaddc"}}}}