-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 to use the systemd driver #5454
Comments
Check out the related discussion at rancher/rke2#2710 |
Moving the discussion from rancher/rke2#2710 back here. Here is how to reproduce the issue: On a clean Debian 11, install k3s using systemd cgroups driver using below command:
The cluster comes up fine, but the default pods in kube-system namespace keeps restarting, and eventually in the
|
As I mentioned in the other discussion, any logs or describe output showing why these pods are crashing would be helpful. Just showing that they are crashing isn't really enough to work with. |
Sorry I thought the reproduce steps are good enough, but here are the logs. |
I think I found the issue. I need to create config.toml.tmpl and add
Back to original feature request, it would be great if k3s installation can have a new flag for enabling systemd cgroup driver that can take care of those manual changes in config.toml and kubelet-arg. |
I do encounter an issue when using config.toml.tmpl. In order to use /etc/rancher/k3s/registries.yaml, I added below to the config.toml.tmpl:
The quotes and backslashes in the Password from registries.yaml aren't being escaped. Without using my own tmpl, k3s can properly escape the passwords from registries.yaml when creating the config.toml. How to properly fix the tmpl so that the Password can be escaped? |
Are you using the template from the source code as a starting point? |
That worked, thanks! The link from https://rancher.com/docs/k3s/latest/en/advanced/ goes to a different template. |
yeah, the template got split out into platform-specific files a while back; the docs just haven't been updated. |
This turned out to be pretty easy to handle; with any luck the May releases will use the systemd cgroup driver automatically when possible. |
Updating the docs rancher/docs#4042 |
Assigning myself to work on the backporting PRs |
I was able to reproduce the issue on k3s v1.23.6+k3s1 on Debian 11 on Linode using the steps to reproduce
Validated fix on k3s v1.23.7-rc1+k3s1
|
This solves the issue where pods were crashlooping. Eg. k3s-io/k3s#5454
I finally got a chance to try out fresh installing the latest stable to confirm the fix on Debian 11 which has systemd 247:
/var/lib/rancher/k3s/agent/etc/containerd/config.toml still shows
I thought the installer will auto detect and set SystemdCgroup to true? |
It will if systemd is compatible. The check is gated on k3s running under systemd, and the |
This is on a clean installation of Debian 11
|
That doesn't tell me whether or not the cpuset cgroup controller is delegated to the k3s service. When k3s is running, what's the output of |
|
Another observation on Debian 11: there is no directory /sys/fs/cgroup/cpuset so I can't see any files in it, but if I manually create that directory, all files are immediately auto populated:
|
Hmm, that's odd. Something doesn't sound quite right. Do you have cgroup v2 enabled, or is this v1 or hybrid? |
I have a fresh installation of Debian 11, which defaults to cgroups v2 based on the release notes . This could be disabled by kernel command line but I didn't do that.
Maybe k3s check code doesn't work on Debian 11 ? |
Here is how I did the k3s installation. Do I need to give any special options to help installer use cgroup v2?
|
The only requirements for autodetecting this should be that you have the cpuset cgroup controller available, and that the
|
Tried |
I do see cpuset cgroup controller
BTW, I see below message in syslog, is it normal?
|
Hmm. Apologies, it looks like this was regressed by a9b5a1933fb. On servers, the You can test the fix on your node with: |
Tried fresh installation using |
Did the install actually work? I don't believe CI is done yet for you to be able to install that commit. Try again shortly, and restart k3s after the install is successful. I tested it from a local build and it does work. |
Installation did actually work:
Restarting didn't help. still shows Just tried fresh install again, no difference. |
What do you get from:
|
|
Hmm, so on your node systemd is not setting Try with |
v248 is very new. Debian 11 uses 247, Ubuntu 20.04 uses 245 and Redhat 8 uses 239. |
|
Yeah, I'm on Ubuntu 22.04 which has 249. Glad that commit works for you! Today is upstream release day, so that commit won't make it into K3s until next month's releases. |
Quote from containerd cgroup driver doc
On Debian 11, does k3s installation default to use systemd driver for containerd? If not, how to configure that?
The text was updated successfully, but these errors were encountered: