{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/contrib/pulls/comments/92913536","pull_request_review_id":13439236,"id":92913536,"diff_hunk":"@@ -0,0 +1,96 @@\n+/*\n+Copyright 2016 The Kubernetes Authors.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+    http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+\n+package waste\n+\n+import (\n+\t\"github.com/golang/glog\"\n+\t\"k8s.io/contrib/cluster-autoscaler/expander\"\n+\t\"k8s.io/contrib/cluster-autoscaler/expander/random\"\n+\t\"k8s.io/kubernetes/pkg/api/resource\"\n+\tapiv1 \"k8s.io/kubernetes/pkg/api/v1\"\n+\t\"k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache\"\n+)\n+\n+type leastwaste struct {\n+\tnext expander.Strategy","path":"cluster-autoscaler/expander/waste/waste.go","position":29,"original_position":29,"commit_id":"fda09f05aa5c2d77cfdf27662f99e3bfe73a983b","original_commit_id":"fda09f05aa5c2d77cfdf27662f99e3bfe73a983b","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":"s/next/fallbackStrategy/","created_at":"2016-12-17T02:40:58Z","updated_at":"2016-12-17T02:40:58Z","html_url":"https://github.com/kubernetes/contrib/pull/2118#discussion_r92913536","pull_request_url":"https://api.github.com/repos/kubernetes/contrib/pulls/2118","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/comments/92913536"},"html":{"href":"https://github.com/kubernetes/contrib/pull/2118#discussion_r92913536"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/2118"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/contrib/pulls/2118","id":96434700,"html_url":"https://github.com/kubernetes/contrib/pull/2118","diff_url":"https://github.com/kubernetes/contrib/pull/2118.diff","patch_url":"https://github.com/kubernetes/contrib/pull/2118.patch","issue_url":"https://api.github.com/repos/kubernetes/contrib/issues/2118","number":2118,"state":"open","locked":false,"title":"Provide multiple strategies for choosing which Node Group to increase","user":{"login":"thebigjc","id":311085,"avatar_url":"https://avatars.githubusercontent.com/u/311085?v=3","gravatar_id":"","url":"https://api.github.com/users/thebigjc","html_url":"https://github.com/thebigjc","followers_url":"https://api.github.com/users/thebigjc/followers","following_url":"https://api.github.com/users/thebigjc/following{/other_user}","gists_url":"https://api.github.com/users/thebigjc/gists{/gist_id}","starred_url":"https://api.github.com/users/thebigjc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thebigjc/subscriptions","organizations_url":"https://api.github.com/users/thebigjc/orgs","repos_url":"https://api.github.com/users/thebigjc/repos","events_url":"https://api.github.com/users/thebigjc/events{/privacy}","received_events_url":"https://api.github.com/users/thebigjc/received_events","type":"User","site_admin":false},"body":"As per #1921, the current cluster-autoscaler chooses a node group to increase at random among the groups that can fit at least one pod. This expands this to two additional strategies:\r\n\r\n- Most Pods - choose the node group that can schedule the most pods, usually due to predicate rules\r\n- Least Waste - choose the node group that has the least remaining CPU resources after a scale up, and if that is tied, the least remaining Memory\r\n\r\nIn the event of a tie, both of these strategies fall back to the current Random method.\r\n\r\nThis probably needs test coverage, to move to its own package, and there could be some weirdness in the algorithms as it needs manual testing.\r\n\r\nLooking mostly to see if I'm on the right track and will proceed after.\r\n\r\n","created_at":"2016-12-04T14:50:19Z","updated_at":"2016-12-17T02:40:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"caa7e40cd281fe4be6399bde55233b18d54268ff","assignee":{"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},"assignees":[{"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}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/contrib/pulls/2118/commits","review_comments_url":"https://api.github.com/repos/kubernetes/contrib/pulls/2118/comments","review_comment_url":"https://api.github.com/repos/kubernetes/contrib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/contrib/issues/2118/comments","statuses_url":"https://api.github.com/repos/kubernetes/contrib/statuses/fda09f05aa5c2d77cfdf27662f99e3bfe73a983b","head":{"label":"thebigjc:scale-up-strategies","ref":"scale-up-strategies","sha":"fda09f05aa5c2d77cfdf27662f99e3bfe73a983b","user":{"login":"thebigjc","id":311085,"avatar_url":"https://avatars.githubusercontent.com/u/311085?v=3","gravatar_id":"","url":"https://api.github.com/users/thebigjc","html_url":"https://github.com/thebigjc","followers_url":"https://api.github.com/users/thebigjc/followers","following_url":"https://api.github.com/users/thebigjc/following{/other_user}","gists_url":"https://api.github.com/users/thebigjc/gists{/gist_id}","starred_url":"https://api.github.com/users/thebigjc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thebigjc/subscriptions","organizations_url":"https://api.github.com/users/thebigjc/orgs","repos_url":"https://api.github.com/users/thebigjc/repos","events_url":"https://api.github.com/users/thebigjc/events{/privacy}","received_events_url":"https://api.github.com/users/thebigjc/received_events","type":"User","site_admin":false},"repo":{"id":75542703,"name":"contrib","full_name":"thebigjc/contrib","owner":{"login":"thebigjc","id":311085,"avatar_url":"https://avatars.githubusercontent.com/u/311085?v=3","gravatar_id":"","url":"https://api.github.com/users/thebigjc","html_url":"https://github.com/thebigjc","followers_url":"https://api.github.com/users/thebigjc/followers","following_url":"https://api.github.com/users/thebigjc/following{/other_user}","gists_url":"https://api.github.com/users/thebigjc/gists{/gist_id}","starred_url":"https://api.github.com/users/thebigjc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thebigjc/subscriptions","organizations_url":"https://api.github.com/users/thebigjc/orgs","repos_url":"https://api.github.com/users/thebigjc/repos","events_url":"https://api.github.com/users/thebigjc/events{/privacy}","received_events_url":"https://api.github.com/users/thebigjc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thebigjc/contrib","description":"This is a place for various components in the Kubernetes ecosystem that aren't part of the Kubernetes core. Consider creating a new repo instead.","fork":true,"url":"https://api.github.com/repos/thebigjc/contrib","forks_url":"https://api.github.com/repos/thebigjc/contrib/forks","keys_url":"https://api.github.com/repos/thebigjc/contrib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thebigjc/contrib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thebigjc/contrib/teams","hooks_url":"https://api.github.com/repos/thebigjc/contrib/hooks","issue_events_url":"https://api.github.com/repos/thebigjc/contrib/issues/events{/number}","events_url":"https://api.github.com/repos/thebigjc/contrib/events","assignees_url":"https://api.github.com/repos/thebigjc/contrib/assignees{/user}","branches_url":"https://api.github.com/repos/thebigjc/contrib/branches{/branch}","tags_url":"https://api.github.com/repos/thebigjc/contrib/tags","blobs_url":"https://api.github.com/repos/thebigjc/contrib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thebigjc/contrib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thebigjc/contrib/git/refs{/sha}","trees_url":"https://api.github.com/repos/thebigjc/contrib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thebigjc/contrib/statuses/{sha}","languages_url":"https://api.github.com/repos/thebigjc/contrib/languages","stargazers_url":"https://api.github.com/repos/thebigjc/contrib/stargazers","contributors_url":"https://api.github.com/repos/thebigjc/contrib/contributors","subscribers_url":"https://api.github.com/repos/thebigjc/contrib/subscribers","subscription_url":"https://api.github.com/repos/thebigjc/contrib/subscription","commits_url":"https://api.github.com/repos/thebigjc/contrib/commits{/sha}","git_commits_url":"https://api.github.com/repos/thebigjc/contrib/git/commits{/sha}","comments_url":"https://api.github.com/repos/thebigjc/contrib/comments{/number}","issue_comment_url":"https://api.github.com/repos/thebigjc/contrib/issues/comments{/number}","contents_url":"https://api.github.com/repos/thebigjc/contrib/contents/{+path}","compare_url":"https://api.github.com/repos/thebigjc/contrib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thebigjc/contrib/merges","archive_url":"https://api.github.com/repos/thebigjc/contrib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thebigjc/contrib/downloads","issues_url":"https://api.github.com/repos/thebigjc/contrib/issues{/number}","pulls_url":"https://api.github.com/repos/thebigjc/contrib/pulls{/number}","milestones_url":"https://api.github.com/repos/thebigjc/contrib/milestones{/number}","notifications_url":"https://api.github.com/repos/thebigjc/contrib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thebigjc/contrib/labels{/name}","releases_url":"https://api.github.com/repos/thebigjc/contrib/releases{/id}","deployments_url":"https://api.github.com/repos/thebigjc/contrib/deployments","created_at":"2016-12-04T14:34:19Z","updated_at":"2016-12-04T14:34:23Z","pushed_at":"2016-12-16T20:17:03Z","git_url":"git://github.com/thebigjc/contrib.git","ssh_url":"git@github.com:thebigjc/contrib.git","clone_url":"https://github.com/thebigjc/contrib.git","svn_url":"https://github.com/thebigjc/contrib","homepage":"","size":41325,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"d2d842a92ff59fb338a5fb1dc3c835db5b4db7ab","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":40686014,"name":"contrib","full_name":"kubernetes/contrib","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/contrib","description":"This is a place for various components in the Kubernetes ecosystem that aren't part of the Kubernetes core. Consider creating a new repo instead.","fork":false,"url":"https://api.github.com/repos/kubernetes/contrib","forks_url":"https://api.github.com/repos/kubernetes/contrib/forks","keys_url":"https://api.github.com/repos/kubernetes/contrib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/contrib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/contrib/teams","hooks_url":"https://api.github.com/repos/kubernetes/contrib/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/contrib/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/contrib/events","assignees_url":"https://api.github.com/repos/kubernetes/contrib/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/contrib/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/contrib/tags","blobs_url":"https://api.github.com/repos/kubernetes/contrib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/contrib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/contrib/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/contrib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/contrib/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/contrib/languages","stargazers_url":"https://api.github.com/repos/kubernetes/contrib/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/contrib/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/contrib/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/contrib/subscription","commits_url":"https://api.github.com/repos/kubernetes/contrib/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/contrib/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/contrib/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/contrib/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/contrib/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/contrib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/contrib/merges","archive_url":"https://api.github.com/repos/kubernetes/contrib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/contrib/downloads","issues_url":"https://api.github.com/repos/kubernetes/contrib/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/contrib/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/contrib/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/contrib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/contrib/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/contrib/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/contrib/deployments","created_at":"2015-08-13T23:18:26Z","updated_at":"2016-12-16T20:07:17Z","pushed_at":"2016-12-17T00:05:41Z","git_url":"git://github.com/kubernetes/contrib.git","ssh_url":"git@github.com:kubernetes/contrib.git","clone_url":"https://github.com/kubernetes/contrib.git","svn_url":"https://github.com/kubernetes/contrib","homepage":"","size":62130,"stargazers_count":699,"watchers_count":699,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":703,"mirror_url":null,"open_issues_count":399,"forks":703,"open_issues":399,"watchers":699,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/2118"},"html":{"href":"https://github.com/kubernetes/contrib/pull/2118"},"issue":{"href":"https://api.github.com/repos/kubernetes/contrib/issues/2118"},"comments":{"href":"https://api.github.com/repos/kubernetes/contrib/issues/2118/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/2118/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/2118/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/contrib/statuses/fda09f05aa5c2d77cfdf27662f99e3bfe73a983b"}}}}
{"actor":{"display_login":"mwielgus"}}