Does k3s support cgroup v2 or will it support it? #11149
davidshen84
started this conversation in
General
Replies: 4 comments 3 replies
-
Yes, k3s supports cgroup v2, same as upstream Kubernetes. No special conditions necessary, it should work out of the box. I suspect there is something wrong with your WSL kernel configuration. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I did not compile my kernel. I use the official kernel with Ubuntu 22.04.
If I install k3s when the system uses *cgroupv2*, I get the "Failed to
start ContainerManager" error message. I tried multiple times.
However, if I install k3s when the system uses "cgruopv1", the k3s service
starts successfully. Then I shutdown WSL and configured it to use
*cgroupv2*. After that, k3s runs successfully.
I did not use a `/etc/rancher/k3s/config.yaml` file. This is how I
configure WSL to use cgroupv2:
```
[wsl2]
swap=32GB
kernelCommandLine = cgroup_no_v1=all systemd.unified_cgroup_hierarchy=1
```
…On Wed, 23 Oct 2024 at 17:50, Brad Davidson ***@***.***> wrote:
Yes, k3s supports cgroup v2, same as upstream Kubernetes. I suspect there
is something wrong with your WSL kernel configuration.
—
Reply to this email directly, view it on GitHub
<#11149 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAQBTMLES6XV6NOOGM45A3Z45BKVAVCNFSM6AAAAABQOBQ3BKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCMBSGU2DGNY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
3 replies
-
With *cgroupv2* enabled, the k3s service fails to start every time after
installation. However, if I shutdown WSL and restart it, the k3s service
will start, but not always.
…On Wed, 23 Oct 2024 at 20:30, Xi Shen ***@***.***> wrote:
I did not compile my kernel. I use the official kernel with Ubuntu 22.04.
If I install k3s when the system uses *cgroupv2*, I get the "Failed to
start ContainerManager" error message. I tried multiple times.
However, if I install k3s when the system uses "cgruopv1", the k3s service
starts successfully. Then I shutdown WSL and configured it to use
*cgroupv2*. After that, k3s runs successfully.
I did not use a `/etc/rancher/k3s/config.yaml` file. This is how I
configure WSL to use cgroupv2:
```
[wsl2]
swap=32GB
kernelCommandLine = cgroup_no_v1=all systemd.unified_cgroup_hierarchy=1
```
On Wed, 23 Oct 2024 at 17:50, Brad Davidson ***@***.***>
wrote:
> Yes, k3s supports cgroup v2, same as upstream Kubernetes. I suspect there
> is something wrong with your WSL kernel configuration.
>
> —
> Reply to this email directly, view it on GitHub
> <#11149 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAAQBTMLES6XV6NOOGM45A3Z45BKVAVCNFSM6AAAAABQOBQ3BKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCMBSGU2DGNY>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Strange...
```
cat /proc/mounts | while IFS= read -r l; do
echo $l | wc -w
done | uniq
```
It shows all lines have six fields.
The fields are parsed at
https://github.com/kubernetes/mount-utils/blob/05c86c7f6d53cf740ce87969fa862d479bdfef38/mount_linux.go#L752,
and it looks good to me.
…On Thu, 24 Oct 2024 at 10:03, Brad Davidson ***@***.***> wrote:
The error is from core Kubernetes, not K3s itself, ref:
https://github.com/kubernetes/kubernetes/blob/v1.31.2/pkg/kubelet/cm/container_manager_linux.go#L155-L158
https://github.com/kubernetes/mount-utils/blob/master/mount_linux.go#L752-L756
This indicates that there is an entry in /proc/mounts with 7 fields
instead of the expected 6. This isn't really something that we can fix in
K3s.
—
Reply to this email directly, view it on GitHub
<#11149 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAQBTI3F56ZLA3L5GRHXPLZ5ATLBAVCNFSM6AAAAABQOBQ3BKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCMBTGQ2TSOI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I enabled cgroup v2 with
kernelCommandLine = cgroup_no_v1=all systemd.unified_cgroup_hierarchy=1
on my WSL system, then I found my k3s server won't start. The error in the log is:The server was restored after I reverted the kernel command line configuration.
The upstream k8s already supported
cgroup v2
at v1.25. How come k3s still doesn't support it at v1.3x? What is the roadmap to align with upstream?Of course, it might be cgroup v2 doesn't work correctly in WSL and failed k3s.
Beta Was this translation helpful? Give feedback.
All reactions