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:
parent
0998c82555
commit
b1b95b5407
3 changed files with 10 additions and 7 deletions
|
|
@ -57,9 +57,10 @@ The renderer reads the service's evaluated unit, not a copy of its settings:
|
||||||
`hyperhive-ca-trust` [below](#secrets);
|
`hyperhive-ca-trust` [below](#secrets);
|
||||||
- trust bundles (any `…/trust-bundle.pem` the environment names), from the
|
- trust bundles (any `…/trust-bundle.pem` the environment names), from the
|
||||||
ConfigMap `hyperhive-ca-trust`, key `trust-bundle.pem`;
|
ConfigMap `hyperhive-ca-trust`, key `trust-bundle.pem`;
|
||||||
- `RuntimeDirectory` as an `emptyDir`, and `StateDirectory` on the
|
- `RuntimeDirectory` as an `emptyDir` in memory, as the `/run` it stands for
|
||||||
service's PersistentVolumeClaim, with `RUNTIME_DIRECTORY` and
|
is, so nothing a service keeps there reaches the node's disk, and
|
||||||
`STATE_DIRECTORY` set the way systemd sets them;
|
`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.
|
- `/etc` files the unit reads, from the service's own ConfigMap.
|
||||||
|
|
||||||
The renderer fails evaluation if an environment value names an absolute
|
The renderer fails evaluation if an environment value names an absolute
|
||||||
|
|
|
||||||
|
|
@ -812,7 +812,9 @@ let
|
||||||
}
|
}
|
||||||
++ lib.optional (runtimeDir != null) {
|
++ lib.optional (runtimeDir != null) {
|
||||||
name = "runtime";
|
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) (
|
++ lib.optional (stateDir != null) (
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1700,15 +1700,15 @@ let
|
||||||
&& lib.elem "bao-token" (mountsOf main)
|
&& lib.elem "bao-token" (mountsOf main)
|
||||||
&&
|
&&
|
||||||
# In memory, so the leaf's key never reaches the node's disk. The
|
# 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.
|
# plain one.
|
||||||
(lib.findFirst (v: v.name == "tls") null spec.volumes) == {
|
(lib.findFirst (v: v.name == "tls") null spec.volumes) == {
|
||||||
name = "tls";
|
name = "tls";
|
||||||
emptyDir.medium = "Memory";
|
emptyDir.medium = "Memory";
|
||||||
}
|
}
|
||||||
&&
|
&&
|
||||||
(lib.findFirst (v: v.name == "runtime") null spec.volumes) == {
|
(lib.findFirst (v: v.name == "tmp") null spec.volumes) == {
|
||||||
name = "runtime";
|
name = "tmp";
|
||||||
emptyDir = { };
|
emptyDir = { };
|
||||||
}
|
}
|
||||||
&& lib.any (e: e.name == "BAO_ADDR") init.env
|
&& lib.any (e: e.name == "BAO_ADDR") init.env
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue