k8s: stt's pod runs in a user namespace of its own
This commit is contained in:
parent
975d4941ef
commit
7a45c7f1b4
1 changed files with 111 additions and 26 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue