-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Allow setting cgroup driver for kubelet #1677
Conversation
ci check this |
The CI failure looks unrelated. "Timeout when waiting for localhost:22" |
Retried the job. |
roles/kubernetes/node/tasks/main.yml
Outdated
@@ -1,4 +1,19 @@ | |||
--- | |||
- name: gather os specific variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this is required? Wouldn't the roles/kubernetes/node/vars/redhat.yml
override for rh family just work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please disregard, this is just am existing pattern reused
roles/kubernetes/node/tasks/main.yml
Outdated
@@ -1,4 +1,19 @@ | |||
--- | |||
- name: gather os specific variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please disregard, this is just am existing pattern reused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please postpone merging unless the failing CI job resolved. Looks unrelated, but has to be fixed first :/
@jistr I fixed master. Can you rebase your PR? |
a4d3ce0
to
6213343
Compare
Rebased |
@jistr I think maybe you are using a different docker RPM than we use. Your PR fails CI on CentOS, which shows that the Docker we install should be run with cgroupfs. Of course, if we should change which Docker to install for centos/rhel/fedora, let's do that to make this PR work. |
Indeed i think we have different docker RPMs. I have the one which comes with CentOS - docker-1.12.6-48.git0fdc778.el7.centos.x86_64. In the CI logs i see there's enabled https://yum.dockerproject.org repos, which i don't think is really necessary and IMO it's not even the expected production scenario for CentOS. At least in the TripleO project we don't have a reason to divert from what comes with the distro -- i'd expect the distro packages to be well tested and stable. If desired i can amend the patch to always default to cgroupfs, and only have it configurable so that we can manually override the default in TripleO. But i think it might be better to switch Kubespray CI to use CentOS packages for docker. (?) |
There would still be a chicken-and-egg issue with this patch though, as if you switched the packages without merging this, the CI would break. Maybe it would be best to autodetect the correct value and make it a fact. |
Which is to say -- i'll update the PR with autodetection. |
Red Hat family platforms run docker daemon with `--exec-opt native.cgroupdriver=systemd`. When kubespray tried to start kubelet service, it failed with: Error: failed to run Kubelet: failed to create kubelet: misconfiguration: kubelet cgroup driver: "cgroupfs" is different from docker cgroup driver: "systemd" Setting kubelet's cgroup driver to the correct value for the platform fixes this issue. The code utilizes autodetection of docker's cgroup driver, as different RPMs for the same distro may vary in that regard.
6213343
to
dbbe941
Compare
Passed CI, and it worked locally for me too. |
@jistr would be nice to document the new |
@bogdando I meant the option mainly as a safety, generally i like automagic to be overridable :) I could mention that this is autodetected and overridable -- is there a place where this would fit in the docs? I tried looking at some of the files in https://github.com/kubernetes-incubator/kubespray/tree/master/docs but they seem to be fairly higher level than this info, but admittedly i didn't go through each file there. |
In CentOS Extras there is also newer Docker, RPM is named docker-latest: |
@jistr you can try this one https://github.com/kubernetes-incubator/kubespray/blob/master/docs/vars.md |
This follows pull request kubernetes-sigs#1677, adding the cgroup-driver autodetection also for kubeadm way of deploying. Info about this and the possibility to override is added to the docs.
Red Hat family platforms run docker daemon with
--exec-opt native.cgroupdriver=systemd
. When kubespray tried to start kubeletservice, it failed with:
Error: failed to run Kubelet: failed to create kubelet: misconfiguration: kubelet cgroup driver: "cgroupfs" is different from docker cgroup driver: "systemd"
Setting kubelet's cgroup driver to the correct value for the platform
fixes this issue.