Watch
0
0
Fork
You've already forked hyperhive
0

k8s: stt's pod runs in a user namespace of its own

This commit is contained in:
atlas 2026-11-23 13:44:57 +01:00 • committed by maia
commit 4e60183bfa

View file

@ -30,10 +30,29 @@ let
apiReady = waitFor 600 "the cluster's API" "${kubectl} get --raw /readyz >/dev/null 2>&1";
caFiles = lib.filterAttrs (_: path: path != null) rendered.caSources;
# The services on the cluster whose pods run in a user namespace.
userNamespaced = lib.filter (name: onCluster ? ${name}) rendered.userNamespaces;
in
{
config = lib.mkIf (node.enable && cfg.enable) (
lib.mkMerge [
# A pod in a user namespace needs idmapped mounts for its volumes, which the
# kernel has for tmpfs from 6.3 on (the projected token and the Secrets
# are tmpfs).
(lib.mkIf (userNamespaced != [ ]) {
assertions = [
{
assertion = lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.3";
message = ''
The pods of ${lib.concatStringsSep ", " userNamespaced} run in a user
namespace (`hostUsers = false`), which needs a kernel of 6.3 or
later; this host's kernel is ${config.boot.kernelPackages.kernel.version}.
'';
}
];
})
(lib.mkIf (onCluster != { }) {
# The cluster applies each file of the manifests directory when it
# appears: a service's objects go in when its host unit has stopped,