{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/35505839","id":35505839,"diff_hunk":"@@ -125,6 +126,10 @@ func findNodesThatFit(pod *api.Pod, podLister algorithm.PodLister, predicateFunc\n \t\t\t\tif _, found := failedPredicateMap[node.Name]; !found {\n \t\t\t\t\tfailedPredicateMap[node.Name] = util.StringSet{}\n \t\t\t\t}\n+\t\t\t\tif predicates.FailedResourceType != \"\" {\n+\t\t\t\t\tfailedPredicateMap[node.Name].Insert(predicates.FailedResourceType)","path":"plugin/pkg/scheduler/generic_scheduler.go","position":13,"original_position":13,"commit_id":"a3e6ff00c0d674aa1bccb25789141d37c235ba9a","original_commit_id":"a3e6ff00c0d674aa1bccb25789141d37c235ba9a","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":"I'm sure I'm missing something obvious, but how does FailedResourceType get passed form CheckPodsExceedingCapacity() into here?","created_at":"2015-07-27T05:04:57Z","updated_at":"2015-07-27T05:04:57Z","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11788#discussion_r35505839","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11788","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments/35505839"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11788#discussion_r35505839"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11788"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11788","id":40736713,"html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11788","diff_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11788.diff","patch_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11788.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11788","number":11788,"state":"open","locked":false,"title":"Improve clarity around PodFitsResource(issue#11453)","user":{"login":"HaiyangDING","id":11399486,"avatar_url":"https://avatars.githubusercontent.com/u/11399486?v=3","gravatar_id":"","url":"https://api.github.com/users/HaiyangDING","html_url":"https://github.com/HaiyangDING","followers_url":"https://api.github.com/users/HaiyangDING/followers","following_url":"https://api.github.com/users/HaiyangDING/following{/other_user}","gists_url":"https://api.github.com/users/HaiyangDING/gists{/gist_id}","starred_url":"https://api.github.com/users/HaiyangDING/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaiyangDING/subscriptions","organizations_url":"https://api.github.com/users/HaiyangDING/orgs","repos_url":"https://api.github.com/users/HaiyangDING/repos","events_url":"https://api.github.com/users/HaiyangDING/events{/privacy}","received_events_url":"https://api.github.com/users/HaiyangDING/received_events","type":"User","site_admin":false},"body":"@bprashanth @davidopp \r\n\r\nRelated issue: https://github.com/GoogleCloudPlatform/kubernetes/issues/11453\r\n\r\nImprove clarity around PodFitsResource by showing pods limits in `kubectl describe node`\r\n\r\nThere are two suggestions in the original PR:\r\n\r\n1. Show what resource failed in the scheduler event\r\n2. Show each pods limits in describe node output\r\n\r\n\"1. Show what resource failed in the scheduler event\" is not implemented in this PR and the reason is given below, any suggestion is welcome:)\r\n\r\nThis PR implements \"2. Show each pods limits in describe node output\".  The output, for example, looks like:\r\n```\r\nName:\t\t\t127.0.0.1\r\nLabels:\t\t\tkubernetes.io/hostname=127.0.0.1\r\nCreationTimestamp:\tThu, 23 Jul 2015 10:37:25 +0000\r\nConditions:\r\n  Type\t\tStatus\tLastHeartbeatTime\t\t\tLastTransitionTime\t\t\tReason\t\t\t\t\tMessage\r\n  Ready \tTrue \tThu, 23 Jul 2015 10:59:37 +0000 \tThu, 23 Jul 2015 10:37:25 +0000 \tkubelet is posting ready status \t\r\nAddresses:\t127.0.0.1\r\nCapacity:\r\n cpu:\t\t4\r\n memory:\t8176512Ki\r\n pods:\t\t40\r\nVersion:\r\n Kernel Version:\t\t3.13.0-46-generic\r\n OS Image:\t\t\tUbuntu precise (12.04.4 LTS)\r\n Container Runtime Version:\tdocker://1.6.0\r\n Kubelet Version:\t\tv1.0.0-557-g5bb5d4ee321aea-dirty\r\n Kube-Proxy Version:\t\tv1.0.0-557-g5bb5d4ee321aea-dirty\r\nExternalID:\t\t\t127.0.0.1\r\nPods:\t\t\t\t(2 in total)\r\n  Namespace\t\t\tName\tCPU-limit(milliCPU)\tMemory-limit(bytes)\r\n  default\t\t\tapache1\t1000\t\t\t8000000\r\n  default\t\t\tapache2\t1000\t\t\t8000000\r\nTotoalResourceLimits:\r\n  CPU-limit(milliCPU):\t2000 (50% of total)\r\n  Memory-limit(bytes):\t16000000 (0% of total)\r\nEvents:\r\n  FirstSeen\t\t\t\tLastSeen\t\t\tCount\tFrom\t\t\tSubobjectPath\tReason\t\tMessage\r\n  Thu, 23 Jul 2015 10:37:25 +0000\tThu, 23 Jul 2015 10:37:25 +0000\t1\t{kubelet 127.0.0.1}\t\t\tstarting\tStarting kubelet.\r\n  Thu, 23 Jul 2015 10:37:25 +0000\tThu, 23 Jul 2015 10:37:25 +0000\t1\t{kubelet 127.0.0.1}\t\t\tNodeReady\tNode 127.0.0.1 status is now: NodeReady\r\n```\r\n\r\nPlease comment if you have any suggestions.\r\n\r\n**Why not showing failed resource in this PR**:\r\n\r\nI have tried to implement \"1. Show what resource failed in the scheduler event\", however, it seems to me that showing failed resource would require much modification in the source code. \r\n\r\n- The PodFitsResources verifies both CPU and Memory together in `func CheckPodsExceedingCapacity()`(https://github.com/GoogleCloudPlatform/kubernetes/blob/master/plugin/pkg/scheduler/algorithm/predicates/predicates.go#L118).\r\n- The return value of `PodFitsResources ` is either (`true`, nil) or (`false`, nil) after calling `func CheckPodsExceedingCapacity()`, so it is quite difficult to pass any specific resource type.\r\n- Based on the facts above, I think specifying failed resource would result in many modifications (for instance, [1]add one more output for `PodFitsResources ` and handles it OR, [2]verify CPU and Memory separately in two functions) which is a huge cost. Maybe just showing enough details in `kubectl describe node` is enough for a user to find out which resource failed for the Pod.\r\n\r\nThese are just my personal opinions, and it is quite possible that there is a good solution which I failed to find. So please feel free to share you ideas in the comments.\r\n\r\nRegards,\r\n\r\nHaiyang DING\r\n\r\n\r\n\r\n","created_at":"2015-07-24T02:03:22Z","updated_at":"2015-07-27T05:04:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23222382428ad629f3a46368ed8fbdfa615b7588","assignee":{"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},"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11788/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11788/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11788/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/a3e6ff00c0d674aa1bccb25789141d37c235ba9a","head":{"label":"HaiyangDING:ImproveClarityResource","ref":"ImproveClarityResource","sha":"a3e6ff00c0d674aa1bccb25789141d37c235ba9a","user":{"login":"HaiyangDING","id":11399486,"avatar_url":"https://avatars.githubusercontent.com/u/11399486?v=3","gravatar_id":"","url":"https://api.github.com/users/HaiyangDING","html_url":"https://github.com/HaiyangDING","followers_url":"https://api.github.com/users/HaiyangDING/followers","following_url":"https://api.github.com/users/HaiyangDING/following{/other_user}","gists_url":"https://api.github.com/users/HaiyangDING/gists{/gist_id}","starred_url":"https://api.github.com/users/HaiyangDING/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaiyangDING/subscriptions","organizations_url":"https://api.github.com/users/HaiyangDING/orgs","repos_url":"https://api.github.com/users/HaiyangDING/repos","events_url":"https://api.github.com/users/HaiyangDING/events{/privacy}","received_events_url":"https://api.github.com/users/HaiyangDING/received_events","type":"User","site_admin":false},"repo":{"id":33019331,"name":"kubernetes","full_name":"HaiyangDING/kubernetes","owner":{"login":"HaiyangDING","id":11399486,"avatar_url":"https://avatars.githubusercontent.com/u/11399486?v=3","gravatar_id":"","url":"https://api.github.com/users/HaiyangDING","html_url":"https://github.com/HaiyangDING","followers_url":"https://api.github.com/users/HaiyangDING/followers","following_url":"https://api.github.com/users/HaiyangDING/following{/other_user}","gists_url":"https://api.github.com/users/HaiyangDING/gists{/gist_id}","starred_url":"https://api.github.com/users/HaiyangDING/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaiyangDING/subscriptions","organizations_url":"https://api.github.com/users/HaiyangDING/orgs","repos_url":"https://api.github.com/users/HaiyangDING/repos","events_url":"https://api.github.com/users/HaiyangDING/events{/privacy}","received_events_url":"https://api.github.com/users/HaiyangDING/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HaiyangDING/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/HaiyangDING/kubernetes","forks_url":"https://api.github.com/repos/HaiyangDING/kubernetes/forks","keys_url":"https://api.github.com/repos/HaiyangDING/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HaiyangDING/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HaiyangDING/kubernetes/teams","hooks_url":"https://api.github.com/repos/HaiyangDING/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/HaiyangDING/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/HaiyangDING/kubernetes/events","assignees_url":"https://api.github.com/repos/HaiyangDING/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/HaiyangDING/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/HaiyangDING/kubernetes/tags","blobs_url":"https://api.github.com/repos/HaiyangDING/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HaiyangDING/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HaiyangDING/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/HaiyangDING/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HaiyangDING/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/HaiyangDING/kubernetes/languages","stargazers_url":"https://api.github.com/repos/HaiyangDING/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/HaiyangDING/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/HaiyangDING/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/HaiyangDING/kubernetes/subscription","commits_url":"https://api.github.com/repos/HaiyangDING/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/HaiyangDING/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/HaiyangDING/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/HaiyangDING/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/HaiyangDING/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/HaiyangDING/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HaiyangDING/kubernetes/merges","archive_url":"https://api.github.com/repos/HaiyangDING/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HaiyangDING/kubernetes/downloads","issues_url":"https://api.github.com/repos/HaiyangDING/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/HaiyangDING/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/HaiyangDING/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/HaiyangDING/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HaiyangDING/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/HaiyangDING/kubernetes/releases{/id}","created_at":"2015-03-28T03:14:48Z","updated_at":"2015-04-21T06:20:07Z","pushed_at":"2015-07-27T03:26:12Z","git_url":"git://github.com/HaiyangDING/kubernetes.git","ssh_url":"git@github.com:HaiyangDING/kubernetes.git","clone_url":"https://github.com/HaiyangDING/kubernetes.git","svn_url":"https://github.com/HaiyangDING/kubernetes","homepage":"http://kubernetes.io","size":94049,"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":"5bd82ffe6da8f4e72e71b362635e558bfc412106","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-27T04:57:58Z","pushed_at":"2015-07-27T03:56:44Z","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":332594,"stargazers_count":9363,"watchers_count":9363,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2146,"mirror_url":null,"open_issues_count":1662,"forks":2146,"open_issues":1662,"watchers":9363,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11788"},"html":{"href":"https://github.com/GoogleCloudPlatform/kubernetes/pull/11788"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11788"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/11788/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11788/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/11788/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/statuses/a3e6ff00c0d674aa1bccb25789141d37c235ba9a"}}}}