Fixing crashing kubernetes pods after migration to cgroups v2

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

After migrating to use cgroups v2 there might be problems with pods crashing after a short time, or rather they terminate. This can be caused by a configuration issue in the /etc/containerd/config.toml file causing pods to be thrown out because of cgroup limits. 

This is a minimal file that worked for me:

disabled_plugins = []

version = 2

[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
SystemdCgroup = true

[plugins."io.containerd.grpc.v1.cri"]
sandbox_image = "registry.k8s.io/pause:3.9"

[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
runtime_type = "io.containerd.runc.v2"