{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/35709247","id":35709247,"diff_hunk":"@@ -0,0 +1,179 @@\n+# Kubernetes compute resource metrics API\n+\n+## Goals\n+\n+Provide resource usage metrics on pods and nodes on the API server to be used\n+by the scheduler to improve job placement, utilization, etc. and by end users\n+to understand the resource utilization of their jobs.\n+\n+## Current state\n+\n+Right now, the Kubelet exports container metrics via an API endpoint. This\n+information is not gathered nor served by the Kubernetes API server.\n+\n+## Use cases\n+\n+The first user will be kubectl. The resource usage data can be shown to the\n+user via a periodically refreshing interface similar to `top` on Unix-like\n+systems. This info could let users assign resource limits more efficiently.\n+\n+```\n+$ kubectl top kubernetes-minion-abcd\n+Pod: monitoring-heapster-abcde\n+CPU:\n+    mean: 0.12 cores\n+    95th: 1.10 cores\n+    max:  1.91 cores\n+Memory:\n+    mean: 300MB (10%)\n+    95th: 330MB (11%)\n+    max:  395MB (13%)\n+```\n+\n+A second user will be the scheduler. To assign pods to nodes efficiently, the\n+scheduler needs to know the current free resources on each node.\n+\n+## Proposed endpoints\n+\n+\t/api/v1/namespaces/myns/podMetrics/mypod/[derived|raw]\n+\t/api/v1/nodeMetrics/myNode/[derived|raw] ","path":"docs/proposals/compute-resource-metrics-api.md","position":39,"original_position":39,"commit_id":"a143da8793b8e3b46f2a8f2dbc648d7d48c11c96","original_commit_id":"a143da8793b8e3b46f2a8f2dbc648d7d48c11c96","user":{"login":"mvdan","id":3576549,"avatar_url":"https://avatars.githubusercontent.com/u/3576549?v=3","gravatar_id":"","url":"https://api.github.com/users/mvdan","html_url":"https://github.com/mvdan","followers_url":"https://api.github.com/users/mvdan/followers","following_url":"https://api.github.com/users/mvdan/following{/other_user}","gists_url":"https://api.github.com/users/mvdan/gists{/gist_id}","starred_url":"https://api.github.com/users/mvdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvdan/subscriptions","organizations_url":"https://api.github.com/users/mvdan/orgs","repos_url":"https://api.github.com/users/mvdan/repos","events_url":"https://api.github.com/users/mvdan/events{/privacy}","received_events_url":"https://api.github.com/users/mvdan/received_events","type":"User","site_admin":false},"body":"@smarterclayton yep, we initially had in mind to do methos on nodes and pods much like what you're saying. If I remember correctly, @bgrant0607 advised against using methods because they usually interact with the node/pod, whereas metrics is a new feature that just gathers data and would be better off in its own endpoint.","created_at":"2015-07-28T22:26:30Z","updated_at":"2015-07-28T22:26:30Z","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11951#discussion_r35709247","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11951","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/35709247"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11951#discussion_r35709247"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11951"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11951","id":41058716,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11951","diff_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11951.diff","patch_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11951.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11951","number":11951,"state":"open","locked":false,"title":"Add compute resource metrics API proposal","user":{"login":"mvdan","id":3576549,"avatar_url":"https://avatars.githubusercontent.com/u/3576549?v=3","gravatar_id":"","url":"https://api.github.com/users/mvdan","html_url":"https://github.com/mvdan","followers_url":"https://api.github.com/users/mvdan/followers","following_url":"https://api.github.com/users/mvdan/following{/other_user}","gists_url":"https://api.github.com/users/mvdan/gists{/gist_id}","starred_url":"https://api.github.com/users/mvdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvdan/subscriptions","organizations_url":"https://api.github.com/users/mvdan/orgs","repos_url":"https://api.github.com/users/mvdan/repos","events_url":"https://api.github.com/users/mvdan/events{/privacy}","received_events_url":"https://api.github.com/users/mvdan/received_events","type":"User","site_admin":false},"body":"CC @vishh\r\n\r\nHaven't paid much attention to the naming of the struct types, they can surely improve.","created_at":"2015-07-28T20:49:23Z","updated_at":"2015-07-28T22:26:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb50df4d5ba1fd0e542bfd9f7270f995da0c63d6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11951/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11951/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11951/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/a143da8793b8e3b46f2a8f2dbc648d7d48c11c96","head":{"label":"mvdan:metrics-api-proposal","ref":"metrics-api-proposal","sha":"a143da8793b8e3b46f2a8f2dbc648d7d48c11c96","user":{"login":"mvdan","id":3576549,"avatar_url":"https://avatars.githubusercontent.com/u/3576549?v=3","gravatar_id":"","url":"https://api.github.com/users/mvdan","html_url":"https://github.com/mvdan","followers_url":"https://api.github.com/users/mvdan/followers","following_url":"https://api.github.com/users/mvdan/following{/other_user}","gists_url":"https://api.github.com/users/mvdan/gists{/gist_id}","starred_url":"https://api.github.com/users/mvdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvdan/subscriptions","organizations_url":"https://api.github.com/users/mvdan/orgs","repos_url":"https://api.github.com/users/mvdan/repos","events_url":"https://api.github.com/users/mvdan/events{/privacy}","received_events_url":"https://api.github.com/users/mvdan/received_events","type":"User","site_admin":false},"repo":{"id":30264775,"name":"kubernetes","full_name":"mvdan/kubernetes","owner":{"login":"mvdan","id":3576549,"avatar_url":"https://avatars.githubusercontent.com/u/3576549?v=3","gravatar_id":"","url":"https://api.github.com/users/mvdan","html_url":"https://github.com/mvdan","followers_url":"https://api.github.com/users/mvdan/followers","following_url":"https://api.github.com/users/mvdan/following{/other_user}","gists_url":"https://api.github.com/users/mvdan/gists{/gist_id}","starred_url":"https://api.github.com/users/mvdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvdan/subscriptions","organizations_url":"https://api.github.com/users/mvdan/orgs","repos_url":"https://api.github.com/users/mvdan/repos","events_url":"https://api.github.com/users/mvdan/events{/privacy}","received_events_url":"https://api.github.com/users/mvdan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mvdan/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/mvdan/kubernetes","forks_url":"https://api.github.com/repos/mvdan/kubernetes/forks","keys_url":"https://api.github.com/repos/mvdan/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mvdan/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mvdan/kubernetes/teams","hooks_url":"https://api.github.com/repos/mvdan/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/mvdan/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/mvdan/kubernetes/events","assignees_url":"https://api.github.com/repos/mvdan/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/mvdan/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/mvdan/kubernetes/tags","blobs_url":"https://api.github.com/repos/mvdan/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mvdan/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mvdan/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/mvdan/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mvdan/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/mvdan/kubernetes/languages","stargazers_url":"https://api.github.com/repos/mvdan/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/mvdan/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/mvdan/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/mvdan/kubernetes/subscription","commits_url":"https://api.github.com/repos/mvdan/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/mvdan/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/mvdan/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/mvdan/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/mvdan/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/mvdan/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mvdan/kubernetes/merges","archive_url":"https://api.github.com/repos/mvdan/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mvdan/kubernetes/downloads","issues_url":"https://api.github.com/repos/mvdan/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/mvdan/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/mvdan/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/mvdan/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mvdan/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/mvdan/kubernetes/releases{/id}","created_at":"2015-02-03T21:10:50Z","updated_at":"2015-02-03T21:10:54Z","pushed_at":"2015-07-28T20:45:52Z","git_url":"git://github.com/mvdan/kubernetes.git","ssh_url":"git@github.com:mvdan/kubernetes.git","clone_url":"https://github.com/mvdan/kubernetes.git","svn_url":"https://github.com/mvdan/kubernetes","homepage":"http://kubernetes.io","size":94256,"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":"GoogleCloudPlatform:master","ref":"master","sha":"a546a2979c09c29c533753a29a8b015eeb3964f7","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"GoogleCloudPlatform/kubernetes","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-07-28T21:18:49Z","pushed_at":"2015-07-28T22:23:11Z","git_url":"git://github.com/GoogleCloudPlatform/kubernetes.git","ssh_url":"git@github.com:GoogleCloudPlatform/kubernetes.git","clone_url":"https://github.com/GoogleCloudPlatform/kubernetes.git","svn_url":"https://github.com/GoogleCloudPlatform/kubernetes","homepage":"http://kubernetes.io","size":335191,"stargazers_count":9419,"watchers_count":9419,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2169,"mirror_url":null,"open_issues_count":1680,"forks":2169,"open_issues":1680,"watchers":9419,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11951"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11951"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11951"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11951/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11951/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11951/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/a143da8793b8e3b46f2a8f2dbc648d7d48c11c96"}}}}