Watch
0
0
Fork
You've already forked hyperhive
0

keep the pods' runtime volume in memory

A service's RuntimeDirectory is a /run, which never reaches a disk; the
pod's volume for it was an emptyDir on the node's disk.
This commit is contained in:
atlas 2026-11-27 22:50:55 +01:00
commit b1b95b5407
3 changed files with 10 additions and 7 deletions

View file

@ -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

View file

@ -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) (
{

View file

@ -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