Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [solved] Runing kubernetes with runit ! (Read 425 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[solved] Runing kubernetes with runit !

Hi everyone,

I am running the runit version of artix linux. First of all I would like to thanks every maintainers for their work.

It may be a strange idea to do so but I am trying to run a local development Kubernetes cluster locally using kind (https://kind.sigs.k8s.io/). This software share a lot of its code with the real Kubernetes but use docker/podman containers as nodes.

This lead to the following error:

Code: [Select]
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "cgroup" to rootfs at "/sys/fs/cgroup": mount cgroup:/sys/fs/cgroup/openrc (via /proc/self/fd/7), flags: 0xe, data: openrc: invalid argument: unknown.

This error seems to be related to stuff systemd is doing related to kernel cgroup v2. Did someone had this issue and found a workaround ?

I am studying the implication of that issue  and trying to solve the issue by myself. I will report here any progress I make. It may be interesting to address this use case in the case someone would need to run a Kubernetes cluster on an artix based server.

Thanks in advance for any response.

Re: Runing kubernetes !

Reply #1
Kind is working with the openrc version of artix. I will try to understand how to transpose this result to runit.

Re: Runing kubernetes !

Reply #2
I finally found a solution !

The issue was that runit is running cgroups in hybrid mode  by default, with both cgroup v1 and v2 enabled, whereas the openrc artix only use cgroups v2.

The solution is to edit the /etc/rc/rc.conf from the runit-rc package in order to enable cgroup v2 only:
 
Code: [Select]
# cgroups mode
# "legacy" mounts cgroups version 1 on /sys/fs/cgroup
# "unified" mounts cgroups version 2 on /sys/fs/cgroup
# "hybrid" mounts cgroups version 2 on /sys/fs/cgroup/unified and
# cgroups version 1 on /sys/fs/cgroup

CGROUP_MODE="unified" # instead of "hybrid" by default <----- fix is here

This allows to create a kind Kubernetes cluster without issues.

I hope this will be useful for runit users who want to run a Kubernetes cluster on a development machine.

 

Re: [solved] Runing kubernetes with runit !

Reply #3
Nice catch, thanks for sharing. You would qualify for joining our team.