<p>I am wondering if <code>systemd</code> could be used as the <strong>cgroup driver</strong> in <strong>cgroup v1</strong> environment.</p>
<p>NOTE: As mentioned in <a href="https://kubernetes.io/docs/setup/production-environment/container-runtimes/" rel="nofollow noreferrer">Kubernetes Container Runtimes Doc</a>, <code>cgroupfs</code> is preferred when the OS have <strong>cgroup v1</strong>.</p>
<p>I have tried to set up a Kubernetes cluster using <code>systemd</code> as <strong>cgroup driver</strong>, and it is working correctly for now.</p>
<p>The test env is:</p>
<ul>
<li>Kubelet: 1.23</li>
<li>OS: Ubuntu 20.04 (Kernel 5.4.0, cgroup v1)</li>
<li>CRI: containerd 1.5.9</li>
<li>Cgroup Driver: systemd</li>
</ul>
<p>Are there any risks by using <code>systemd</code> in <strong>cgroup v1</strong> env?</p>

Wolphy
<blockquote>
<p>NOTE: As mentioned in Kubernetes Container Runtimes Doc, cgroupfs is preferred when the OS have cgroup v1.</p>
</blockquote>
<p>Can you specify which paragraph is this? If not mistaken the document didn't state cgroupfs is preferred over systemd for distro that uses cgroup v1. systemd is widely accepted as the init system but cgroup v2 is available only if you run a fairly new (&gt;=5.8) kernel.</p>
<blockquote>
<p>Are there any risks by using systemd in cgroup v1 env?</p>
</blockquote>
<p>Cgroup v1 is mostly in-use to date and systemd is designed to work with it. That being said, cgroupfs is the default for kubelet at this time of writing. As kernel mature overtime, systemd may one day become the default and all the backing CRI will follow thru.</p>
<p>A side note, docker default to cgroupfs on system that only support cgroup v1 (regardless if systemd is present). It will use systemd on system that uses cgroup v2 and systemd is present. However, k8s has dropped docker as the CRI with the removal of dockershim starting v1.24. You can continue with dockershim with <a href="https://www.mirantis.com/blog/mirantis-to-take-over-support-of-kubernetes-dockershim-2/" rel="nofollow noreferrer">Mirantis</a>.</p>
