nixos/kubernetes: actually set containerd to use systemd cgroups

The correct configuration is listed in the kubernetes documentation
https://kubernetes.io/docs/setup/production-environment/container-runtimes/#containerd-systemd

The correct option can also be seen in `containerd config default`
This commit is contained in:
Thomas Dy 2021-12-18 22:18:10 +09:00 committed by zowoq
parent 2d356a1969
commit 97864e984d
3 changed files with 1 additions and 13 deletions

View file

@ -26,10 +26,7 @@ let
containerd.runtimes.runc = {
runtime_type = "io.containerd.runc.v2";
};
containerd.runtimes."io.containerd.runc.v2".options = {
SystemdCgroup = true;
options.SystemdCgroup = true;
};
};
};

View file

@ -264,8 +264,6 @@ in
"net.bridge.bridge-nf-call-ip6tables" = 1;
};
systemd.enableUnifiedCgroupHierarchy = false; # true breaks node memory metrics
systemd.services.kubelet = {
description = "Kubernetes Kubelet Service";
wantedBy = [ "kubernetes.target" ];

View file

@ -60,13 +60,6 @@ let
advertiseAddress = master.ip;
};
masterAddress = "${masterName}.${config.networking.domain}";
# workaround for:
# https://github.com/kubernetes/kubernetes/issues/102676
# (workaround from) https://github.com/kubernetes/kubernetes/issues/95488
kubelet.extraOpts = ''\
--cgroups-per-qos=false \
--enforce-node-allocatable="" \
'';
};
}
(optionalAttrs (any (role: role == "master") machine.roles) {