diff --git a/docs/4-implementation/k8s/manifests.md b/docs/4-implementation/k8s/manifests.md index 190aaf1fc..d3547b3e4 100644 --- a/docs/4-implementation/k8s/manifests.md +++ b/docs/4-implementation/k8s/manifests.md @@ -57,9 +57,10 @@ The renderer reads the service's evaluated unit, not a copy of its settings: `hyperhive-ca-trust` [below](#secrets); - trust bundles (any `…/trust-bundle.pem` the environment names), from the ConfigMap `hyperhive-ca-trust`, key `trust-bundle.pem`; - - `RuntimeDirectory` as an `emptyDir`, and `StateDirectory` on the - service's PersistentVolumeClaim, with `RUNTIME_DIRECTORY` and - `STATE_DIRECTORY` set the way systemd sets them; + - `RuntimeDirectory` as an `emptyDir` in memory, as the `/run` it stands for + is, so nothing a service keeps there reaches the node's disk, and + `StateDirectory` on the service's PersistentVolumeClaim, with + `RUNTIME_DIRECTORY` and `STATE_DIRECTORY` set the way systemd sets them; - `/etc` files the unit reads, from the service's own ConfigMap. The renderer fails evaluation if an environment value names an absolute diff --git a/nix/host-modules/k8s/render.nix b/nix/host-modules/k8s/render.nix index 763417497..bc38065e2 100644 --- a/nix/host-modules/k8s/render.nix +++ b/nix/host-modules/k8s/render.nix @@ -812,7 +812,9 @@ let } ++ lib.optional (runtimeDir != null) { name = "runtime"; - emptyDir = { }; + # In memory, as the `/run` it stands for is: what a service keeps there + # never reaches the node's disk. + emptyDir.medium = "Memory"; } ++ lib.optional (stateDir != null) ( { diff --git a/nix/module-eval/k8s.nix b/nix/module-eval/k8s.nix index 9b8db07dc..8032b8218 100644 --- a/nix/module-eval/k8s.nix +++ b/nix/module-eval/k8s.nix @@ -1700,15 +1700,15 @@ let && lib.elem "bao-token" (mountsOf main) && # In memory, so the leaf's key never reaches the node's disk. The - # runtime volume beside it is the control that the lookup finds a + # `tmp` volume beside it is the control that the lookup finds a # plain one. (lib.findFirst (v: v.name == "tls") null spec.volumes) == { name = "tls"; emptyDir.medium = "Memory"; } && - (lib.findFirst (v: v.name == "runtime") null spec.volumes) == { - name = "runtime"; + (lib.findFirst (v: v.name == "tmp") null spec.volumes) == { + name = "tmp"; emptyDir = { }; } && lib.any (e: e.name == "BAO_ADDR") init.env