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

[Kubelet] Add support for pod level cgroup management #28017

Closed
wants to merge 1 commit into from

Conversation

dubstack
Copy link

@dubstack dubstack commented Jun 24, 2016

This PR is tied to this upstream issue #27204

This PR adds support for creating destroying and updating pod level cgroups in the Kubelet. I need the node info(Allocatable and Capacity values tp be specific) for updating the limits on the pod and top level cgroups. I pass the nodeInfo from the Kubelet to the containerManager's Start() method and then cache it in the ContainerManager. This is not the very best way to handle this requirement. But cm object is created in app/server.go where I believe we don't have the Node info at that point. cc @derekwaynecarr.

I would injecting calls to podContainerManager create and delete methods in the next PR. Also the containers would be brought up under the pod level cgroups. So I would like to get these merged only after this code has been well tested in the next PR.

@vishh @derekwaynecarr @Random-Liu Please do a review.

cc @kubernetes/sig-node


This change is Reviewable

@dubstack dubstack added the sig/node Categorizes an issue or PR as relevant to SIG Node. label Jun 24, 2016
@dubstack dubstack assigned dubstack and vishh and unassigned dubstack Jun 24, 2016
@k8s-github-robot k8s-github-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. release-note-label-needed labels Jun 24, 2016
@dubstack dubstack added do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels Jun 24, 2016
}

func (m *podContainerManagerStub) GetPodContainerName(pod *api.Pod) string {
return ""
Copy link
Author

Choose a reason for hiding this comment

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

I missed this but it would return the cgroup-root in this case

@dubstack dubstack force-pushed the dubstack-pod-manager branch 4 times, most recently from 020f678 to d2e1d72 Compare June 27, 2016 09:14
@dubstack dubstack removed the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jun 27, 2016
@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 27, 2016
@dubstack dubstack force-pushed the dubstack-pod-manager branch 2 times, most recently from f6a02d2 to 617d427 Compare June 28, 2016 21:54
@dubstack dubstack changed the title [Do not Merge]Add support for pod level cgroup management [Kubelet] Add support for pod level cgroup management Jun 28, 2016
@dubstack dubstack added area/kubelet and removed do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. labels Jun 28, 2016
@k8s-github-robot k8s-github-robot added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Jun 28, 2016
},
}
}

// TODO(vmarmol): Add limits to the system containers.
Copy link
Author

Choose a reason for hiding this comment

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

Later when we handle system containers we would want to replace this manager with my cgroup Manager

@dubstack dubstack added the do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. label Jun 28, 2016
@dubstack dubstack force-pushed the dubstack-pod-manager branch 3 times, most recently from 8d6aaf4 to f9086f1 Compare June 29, 2016 20:35
@k8s-github-robot k8s-github-robot added do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. retest-not-required-docs-only and removed retest-not-required-docs-only labels Jul 28, 2016
@k8s-github-robot
Copy link

@dubstack
You must link to the test flake issue which caused you to request this manual re-test.
Re-test requests should be in the form of: k8s-bot test this issue: #<number>
Here is the list of open test flakes.

@dubstack
Copy link
Author

dubstack commented Jul 28, 2016

k8s-bot e2e test this issue: #29559

@dubstack
Copy link
Author

k8s-bot test this issue: #29559

@dubstack dubstack force-pushed the dubstack-pod-manager branch from c2355d2 to a01c8cd Compare July 28, 2016 18:04
@dubstack dubstack removed the do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. label Jul 28, 2016
@derekwaynecarr
Copy link
Member

@dubstack - I am ok addressing nits in a follow-on, can you get tests passing so I can tag?

@dubstack
Copy link
Author

Looks like #29492 reverted changes that I made to Libcontainer which broke down the e2e tests

NewPodContainerManager() PodContainerManager

// GetMountedSubsystems returns the mounted cgroup subsytems on the node
GetMountedSubsystems() *CgroupSubsystems
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this method exported?

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

it feels like the factoring could be better here. it feels like reducing memory limits should be handled in a module opaque to the kubelet.

Copy link
Author

Choose a reason for hiding this comment

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

Done

@vishh
Copy link
Contributor

vishh commented Aug 3, 2016

@dubstack DId a review pass. Please ping once you have addressed comments.

@derekwaynecarr
Copy link
Member

took one more pass, i would prefer if its not too much work that we fix to use a NodeCapacityProvider interface now so we are not chasing down uses of *Node in future.

@dubstack dubstack force-pushed the dubstack-pod-manager branch from a01c8cd to 1eebf62 Compare August 4, 2016 22:08
@dubstack
Copy link
Author

dubstack commented Aug 4, 2016

@derekwaynecarr @vishh I understand your concern. I will send out a patch to refactor it to use a NodeCapacityInterface. But for now can we get this in.

@dubstack dubstack force-pushed the dubstack-pod-manager branch from 1eebf62 to b1018be Compare August 4, 2016 22:18
@dubstack
Copy link
Author

dubstack commented Aug 4, 2016

This commit would be added by #29087. Close this one on LGTM.

@k8s-bot
Copy link

k8s-bot commented Aug 4, 2016

GCE e2e build/test passed for commit b1018be.

@dubstack
Copy link
Author

@derekwaynecarr @vishh Closing this PR as the commit from this PR will go in #30475.

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.

@dubstack dubstack closed this Aug 20, 2016
k8s-github-robot pushed a commit that referenced this pull request Aug 20, 2016
Automatic merge from submit-queue

Unblock iterative development on pod-level cgroups

In order to allow forward progress on this feature, it takes the commits from #28017 #29049 and then it globally disables the flag that allows these features to be exercised in the kubelet.  The flag can be re-added to the kubelet when its actually ready.

/cc @vishh @dubstack @kubernetes/rh-cluster-infra
xingzhou pushed a commit to xingzhou/kubernetes that referenced this pull request Dec 15, 2016
Automatic merge from submit-queue

Unblock iterative development on pod-level cgroups

In order to allow forward progress on this feature, it takes the commits from kubernetes#28017 kubernetes#29049 and then it globally disables the flag that allows these features to be exercised in the kubelet.  The flag can be re-added to the kubelet when its actually ready.

/cc @vishh @dubstack @kubernetes/rh-cluster-infra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubelet release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants