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

containerd: use systemd cgroup driver by default? #1726

Closed
AkihiroSuda opened this issue Jul 13, 2020 · 15 comments
Closed

containerd: use systemd cgroup driver by default? #1726

AkihiroSuda opened this issue Jul 13, 2020 · 15 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Milestone

Comments

@AkihiroSuda
Copy link
Member

What would you like to be added:
Use systemd cgroup driver by default

Why is this needed:
Because it is recommended on systemd hosts: https://kubernetes.io/docs/setup/production-environment/container-runtimes/

@AkihiroSuda AkihiroSuda added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 13, 2020
@aojea
Copy link
Contributor

aojea commented Jul 13, 2020

this seems a simple change, @AkihiroSuda do you know there can be issues due to be running in nested containers?
I mean, let's says docker runs in the host with cgroupfs, and kubelet inside the kind node (docker container) with systemd driver (this systemd process is runnig inside a cgroup already)

@tao12345666333
Copy link
Member

Maybe there is no problem?

Currently, my docker is using systemd as the cgroup driver, and cgroupfs is used in KIND.

I will test locally and give the results as soon as possible

@BenTheElder
Copy link
Member

That page talks about having two controllers, but if it intends to recommend it, the language there could do with some updating, I wouldn't really call that "recommends". Nowhere does it say "you should do this".

I'd want to know that we're not going to cause a regression here.

We also want to be doing something like the changes in https://d2iq.com/blog/running-kind-inside-a-kubernetes-cluster-for-continuous-integration with custom kubepods path etc. sooner rather than later, cc @jieyu xref: #1614.

@AkihiroSuda
Copy link
Member Author

For cgroup v2, runc explicitly recommends systemd driver, though it is still opt-in.
https://github.com/opencontainers/runc/blob/master/docs/cgroup-v2.md#systemd

Podman and Docker already switched the default on v2 to systemd.

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 11, 2020
@BenTheElder BenTheElder removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 2, 2020
@kubernetes-sigs kubernetes-sigs deleted a comment from fejta-bot Nov 2, 2020
@BenTheElder
Copy link
Member

cc @neolit123
/assign

@BenTheElder BenTheElder added this to the v0.11.0 milestone Jan 25, 2021
@BenTheElder
Copy link
Member

We should strongly consider this in v0.11.0, see also kubernetes/kubernetes#96594 for some excitement around kind's (poor) behavior with cgroups v1 currently ...

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 25, 2021
@kubernetes-sigs kubernetes-sigs deleted a comment from fejta-bot Apr 26, 2021
@BenTheElder BenTheElder removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 26, 2021
@BenTheElder BenTheElder modified the milestones: v0.11.0, v0.13.0, v0.12.0 May 18, 2021
@BenTheElder
Copy link
Member

Noting that there's currently some issues upstream with runc upgrade and systemd
kubernetes/kubernetes#88197 kubernetes/kubernetes#102094

@BenTheElder
Copy link
Member

There is some cri-o CI in Kubernetes related to this now but still this driver continues to have problems kubernetes/kubernetes#102508 (comment)

@BenTheElder
Copy link
Member

This driver is getting more testing upstream but still seems to have major issues kubernetes/kubernetes#104280 😬

@adisky
Copy link

adisky commented Oct 1, 2021

Now there is systemd cgroup job for containerd as well
https://testgrid.k8s.io/sig-node-containerd#cgroup-systemd-containerd-node-e2e

@aojea aojea modified the milestones: v0.12.0, v0.13.0 Oct 29, 2021
@BenTheElder
Copy link
Member

I was just talking to @stevekuznetsov about this, we are in a weird state right now where we are cgroupfs + systemd.

kubeadm 1.22+ switched to systemd by default, and I think this is fairly well tested now. Also it is likely problematic on cgroupv2 (though ... kind is working there at least in CI environment and some users ...).

We should update kind build node-image to patch the default containerd config to use systemd cgroup driver for kubernetes 1.22+ builds.

That will fix this even for older kind binaries, and it's cheaper than another runtime check. It will still be possible to override at runtime with config patches.

@BenTheElder BenTheElder removed their assignment Mar 10, 2022
@BenTheElder
Copy link
Member

P.S. apologies in advance if anyone takes that up, that code is a bit messy in particular 😬 , it should not be a difficult change though.

@aojea aojea added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Mar 10, 2022
@BenTheElder
Copy link
Member

/remove-help
/assign

Existing proposal is not quite enough if we want to avoid breaking changes, because in the kubeadm config we emit from existing kind binaries we're specifying the kubelet cgroup driver (to avoid kubeadm in 1.21+ overriding the kubelet's actual default).

Considering alternatives. Will PR soon.

@k8s-ci-robot k8s-ci-robot removed the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label May 3, 2022
@BenTheElder
Copy link
Member

In #2737, thinking is to basically do what kubeadm did, and just say "1.24.0 onwards uses systemd" (and will require the next kind release to use), treating it as breaking then (instead of 1.21 which we already patched over.

it's not unusual for a new kubernetes release to require a new kind version because of some change in kubernetes. the fact that we deferred it a few releases seems fine.

@BenTheElder
Copy link
Member

kubernetes v1.24.0+ and kind v0.13.0+ will do this.

jsenko added a commit to Apicurio/apicurio-registry-k8s-tests-e2e that referenced this issue Sep 9, 2022
hongtaiwang added a commit to vmware-tanzu/tanzu-framework that referenced this issue Nov 16, 2022
Kind images for k8s v1.24 require `cgroup-driver: systemd` to be set

kubernetes-sigs/kind#1726
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

6 participants