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
|
|
@ -153,9 +153,10 @@ let
|
|||
# containers, init containers, volumes, host aliases, pod settings, objects and
|
||||
# and images. An `otlp` of `"none"` is a daemon that pushes no telemetry of its
|
||||
# own.
|
||||
# `egress`, where a service has it, names the host services its pod may reach
|
||||
# (`hostPorts`). The pod then gets a NetworkPolicy that lets it reach those
|
||||
# and cluster DNS and nothing else, and that admits no ingress.
|
||||
# `egress`, where a service has it, names the host services (`hostPorts`) its
|
||||
# pod may reach: it gets a NetworkPolicy that allows those and cluster DNS and
|
||||
# admits no ingress. `hostUsers = false` runs the pod in a user namespace of
|
||||
# its own, so its ids map to unprivileged ones on the node.
|
||||
services = {
|
||||
swarm-controller = {
|
||||
inherit (controllerCfg) enable package unit;
|
||||
|
|
@ -233,6 +234,9 @@ let
|
|||
];
|
||||
otlp = "hive";
|
||||
ephemeralState = true;
|
||||
# Stands in for the unit's `PrivateUsers`: the decoder reads audio that
|
||||
# strangers sent.
|
||||
hostUsers = false;
|
||||
switch = {
|
||||
inherit (deployCfg.stt) runtime;
|
||||
hostUnit = "container@swarm-stt.service";
|
||||
|
|
@ -912,6 +916,7 @@ let
|
|||
};
|
||||
}
|
||||
// lib.optionalAttrs baoLogin { serviceAccountName = name; }
|
||||
// lib.optionalAttrs (svc ? hostUsers && !svc.hostUsers) { hostUsers = false; }
|
||||
// lib.optionalAttrs (listener != { } || extra.initContainers != [ ]) {
|
||||
initContainers = lib.optional (listener != { }) leafContainer ++ extra.initContainers;
|
||||
}
|
||||
|
|
@ -1068,6 +1073,10 @@ in
|
|||
switches = lib.mapAttrs (_: svc: svc.switch) (
|
||||
lib.filterAttrs (_: svc: svc.enable && svc.switch != null) services
|
||||
);
|
||||
# The services whose pods run in a user namespace. Cheap to read, like `switches`.
|
||||
userNamespaces = lib.attrNames (
|
||||
lib.filterAttrs (_: svc: svc.enable && svc ? hostUsers && !svc.hostUsers) services
|
||||
);
|
||||
services = lib.mapAttrs (_: w: { inherit (w) objects; }) enabled;
|
||||
inherit caConfigMap caSources;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue