Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce --max-pods in kubelet admission; previously was only enforced in scheduler #24674

Merged
merged 1 commit into from Apr 23, 2016

Conversation

gmarek
Copy link
Contributor

@gmarek gmarek commented Apr 22, 2016

This is an ugly hack - I spent some time trying to understand what one NodeInfo has in common with the other one, but at some point decided that I just don't have time to do that.

Fixes #24262
Fixes #20263

cc @HaiyangDING @lavalamp

@gmarek gmarek added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Apr 22, 2016
@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-label-needed labels Apr 22, 2016
@gmarek gmarek closed this Apr 22, 2016
@gmarek gmarek reopened this Apr 22, 2016
@k8s-bot
Copy link

k8s-bot commented Apr 22, 2016

GCE e2e build/test passed for commit 983a5962f57e8f05539253f107cbb15745a16f22.

return false,
newInsufficientResourceError(podCountResourceName, 1, int64(len(nodeInfo.Pods())), allowedPodNumber)
}

Copy link
Member

@wojtek-t wojtek-t Apr 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do't like it.

What we should do is to insted of calling podFitsResourcesInternal above, call just PodFitsResources and remove it from here.
Then we can even remove podFitsResourcesInternal completely since it will not be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not that easy. PodFitsResources is a NodeStatus method, which needs predicates.NodeInfo. I can probably create one from the things I have here, but it'd be as ugly as this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aah - ok. let's leave as it - I will fix that in my PR where I'm changing it :)
With #24598 - it should be easy to do :)

@gmarek
Copy link
Contributor Author

gmarek commented Apr 22, 2016

@k8s-bot unit test this issue: #24680

@gmarek
Copy link
Contributor Author

gmarek commented Apr 22, 2016

cc @yujuhong

@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 22, 2016
@yujuhong
Copy link
Contributor

@gmarek, I don't think the failed kubelet unit tests have the allocatable resources set, and I guess that could be the problem. You should set the numbers for them like this test.

@gmarek
Copy link
Contributor Author

gmarek commented Apr 22, 2016

Yup - that's what I did:) I added you, as I'm modifying Kubelet tests.

@gmarek
Copy link
Contributor Author

gmarek commented Apr 22, 2016

(Travis just doesn't work today)

@yujuhong
Copy link
Contributor

Yup - that's what I did:) I added you, as I'm modifying Kubelet tests.

Cool. The tests look good. I think we'll deprecate these tests soon (since they are tested in the predicate library) and replace them with one generic admission test.

@k8s-bot
Copy link

k8s-bot commented Apr 22, 2016

GCE e2e build/test passed for commit b35864593c8b9075a4b9a41a21dbbf693f162c25.

@@ -775,6 +775,14 @@ func RunGeneralPredicates(pod *api.Pod, nodeName string, nodeInfo *schedulercach
if !fit {
return fit, err
}
// TODO(HaiyangDING): Make a proper fix for it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the comment here should instead be exactly the same comment as the other place where we check max pods, namely

// TODO: move the following podNumber check to podFitsResourcesInternal when Kubelet allows podNumber check (See #20263).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@davidopp davidopp added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed labels Apr 22, 2016
@davidopp
Copy link
Member

Since the release notes are generated from the PR title, I would suggest re-titling this PR to something like "enforce --max-pods in kubelet admission; previously was only enforced in scheduler"

Also, noting here that this PR fixes #20263.

@gmarek gmarek changed the title Fix MaxPods feature in scheduler Enforce --max-pods in kubelet admission; previously was only enforced in scheduler Apr 22, 2016
@davidopp davidopp added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 22, 2016
@davidopp
Copy link
Member

LGTM

@yujuhong said change to have Kubelet enforce --max-pods is OK

@k8s-bot
Copy link

k8s-bot commented Apr 22, 2016

GCE e2e build/test passed for commit e0712f7.

@k8s-bot
Copy link

k8s-bot commented Apr 22, 2016

GCE e2e build/test passed for commit e0712f7.

@gmarek
Copy link
Contributor Author

gmarek commented Apr 23, 2016

@k8s-bot unit test this issue: #24704

@k8s-bot
Copy link

k8s-bot commented Apr 23, 2016

GCE e2e build/test passed for commit e0712f7.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Apr 23, 2016

GCE e2e build/test passed for commit e0712f7.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 2ec9080 into kubernetes:master Apr 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants