rancher / k3os

Purpose-built OS for Kubernetes, fully managed by Kubernetes.
https://k3os.io
Apache License 2.0
3.5k stars 397 forks source link

support cgroups v2 and/or move cgroups setup to OpenRC #733

Open dxlr8r opened 3 years ago

dxlr8r commented 3 years ago

rc.go from linuxkit enforces and sets up cgroups v1: https://github.com/rancher/k3os/blob/4738bb8f7c4bfcb22656e536077d71bd30c1138f/pkg/cli/rc/rc.go#L234-L241

So this /k3os/system/config.yaml example will not work:

- content: |
    rc_cgroup_mode="unified"
    rc_cgroup_controllers="memory"
  owner: root
  path: /etc/conf.d/cgroups

I suggest moving this functionality out of rc.go and into OpenRC where it belongs. OpenRC already has an cgroup service that is capable of setting up cgroups v1 or v2.

In my opinion k3OS should also default to cgroups v2, as k3s has no issues with it. I am currently running cgroups v2 on k3OS with no issues, just need to add more hacks than the example above.