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

cluster up: set docker cgroup driver on kubelet config #13964

Merged
merged 2 commits into from
May 12, 2017

Conversation

csrwng
Copy link
Contributor

@csrwng csrwng commented Apr 28, 2017

Fixes issue which requires that cgroup driver be specified for kubelet post 1.6 kube rebase.

Fixes #14101

@csrwng
Copy link
Contributor Author

csrwng commented Apr 28, 2017

/cc @spadgett @ncdc fyi

This fixes the issue on mac with the post-rebase codebase. However, just recently discovered that it breaks previous versions of the images because the --cgroup-driver flag is not recognized.

I'm thinking that maybe a better approach would be to change the startup code to default to the cgroup driver used by docker.

@csrwng
Copy link
Contributor Author

csrwng commented Apr 28, 2017

@sttts is there a reason you hardcoded systemd as the cgroup driver?
47d3923#diff-4b02478f33beffa6bf667358f137e2adR164

It breaks us on non-systemd distros like moby (Docker for Mac/Windows)

@ncdc
Copy link
Contributor

ncdc commented Apr 29, 2017

@csrwng we hardcoded ot systemd mainly because that's the primary deployment target (Fedora/CentOS/RHEL with systemd). However, given that this is causing issues, I agree that it would be better to have the startup logic for the node attempt to set this automagically.

if nodeCfg.KubeletArguments == nil {
nodeCfg.KubeletArguments = configapi.ExtendedArguments{}
}
nodeCfg.KubeletArguments["cgroup-driver"] = []string{cgroupDriver}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this intentional that cgroup-driver is overridden? Shouldn't we keep an existing value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stts this is just setting it to whatever docker reports is its cgroupDriver instead of the hardcoded systemd value. (only for the case of cluster up)

@csrwng
Copy link
Contributor Author

csrwng commented May 5, 2017

I agree that it would be better to have the startup logic for the node attempt to set this automagically.

@ncdc do you know of a way to detect whether the systemd cgroup driver is available?

@ncdc
Copy link
Contributor

ncdc commented May 5, 2017

do you know of a way to detect whether the systemd cgroup driver is available?

No clue, sorry

@spadgett
Copy link
Member

spadgett commented May 8, 2017

Even after updating the cgroup driver, no nodes become available for me with cluster up --latest. See #14101

@csrwng csrwng force-pushed the set_cgroup_driver branch from 952ff2c to 20aec94 Compare May 8, 2017 17:36
@csrwng
Copy link
Contributor Author

csrwng commented May 8, 2017

@spadgett I added a commit with additional kubelet flags which get this to work.
@derekwaynecarr can you take a look at the second commit with 2 additional flags that I'm setting when cgroup driver != "systemd" ? Is that ok?

@csrwng csrwng force-pushed the set_cgroup_driver branch from 20aec94 to e12c2b6 Compare May 8, 2017 18:09
@csrwng csrwng changed the title [WIP] cluster up: set docker cgroup driver on kubelet config cluster up: set docker cgroup driver on kubelet config May 8, 2017
@csrwng
Copy link
Contributor Author

csrwng commented May 8, 2017

Removed the WIP in the title. This is now working for all versions.
@bparees ptal

@spadgett
Copy link
Member

spadgett commented May 8, 2017

@csrwng Validated the fix. Works great!

@bparees
Copy link
Contributor

bparees commented May 8, 2017

@csrwng lgtm, did you still want @derekwaynecarr to look at the flags?

@csrwng
Copy link
Contributor Author

csrwng commented May 8, 2017

yes, @derekwaynecarr it'd be great if you can check that I'm not doing anything dumb. Just keep in mind that this is only for cluster up use cases.

@derekwaynecarr
Copy link
Member

@csrwng -- the issue when debugging with you is that these VMs have a cgroup "openrc" that is not known to runc ;-) because it appears as a mounted subsystem in the cgroupfs, and we do not see changes in that subsystem (cause runc doesnt appear to know it), we think that things that did create did not actually create. we need to make kubelet ignore openrc if its found as the proper fix.

@derekwaynecarr
Copy link
Member

@csrwng -- finding the least hacky way to ignore openrc is my first priority tomorrow.

@derekwaynecarr
Copy link
Member

opened opencontainers/runc#1440
kube workaround kubernetes/kubernetes#45515

nodeCfg.KubeletArguments = configapi.ExtendedArguments{}
}
nodeCfg.KubeletArguments["cgroup-driver"] = []string{cgroupDriver}
if cgroupDriver != "systemd" {
Copy link
Member

Choose a reason for hiding this comment

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

this should not be necessary with kubernetes/kubernetes#45515

can you pull that locally and verify it works for you?

if you verify, we can carry a patch in origin.

@csrwng csrwng force-pushed the set_cgroup_driver branch from e12c2b6 to ef6b4e9 Compare May 9, 2017 19:35
@csrwng
Copy link
Contributor Author

csrwng commented May 9, 2017

@derekwaynecarr Updated to include your upstream commit and not set the additional arguments.
I tested it and it works with the Linux distro in Docker for Mac.

@derekwaynecarr
Copy link
Member

i need to address one-nit in the usptream pr, can we merge this once i have that handled?

csrwng added 2 commits May 11, 2017 08:58
On kubelet versions that support the --cgroup-driver
argument, set the cgroup-driver flag to the one reported by docker.
@csrwng csrwng force-pushed the set_cgroup_driver branch from ef6b4e9 to 76838dd Compare May 11, 2017 12:59
@csrwng
Copy link
Contributor Author

csrwng commented May 11, 2017

I have updated this with the merged version of the upstream commit
[merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 76838dd

@openshift-bot
Copy link
Contributor

[Test]ing while waiting on the merge queue

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 76838dd

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/1345/) (Base Commit: 2628c77)

@openshift-bot
Copy link
Contributor

openshift-bot commented May 12, 2017

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/620/) (Base Commit: 9bcaa0a) (Image: devenv-rhel7_6225)

@openshift-bot openshift-bot merged commit 4f2b9d7 into openshift:master May 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants