k8s: the store-credential unit starts at fork, off the boot and switch path
`swarm-bao-store-auth` was a retrying oneshot on multi-user.target. A oneshot's start job stays pending through its restarts, so a boot or a switch with the secret store sealed waited on it for up to 15 minutes, the same shape as #6901's CA publisher. It is now `Type=simple` with the shared retry kept: the start job is done at fork and the unit keeps trying until the store answers. `RemainAfterExit` leaves it `active (exited)` once the credential is out, and the 15-minute start timeout goes, as a start job done at fork has no use for it. Nothing orders after the unit: the gateway reads the file at its next reload and the pods wait in ContainerCreating for the Secret. `is-active` is now true while the script runs and `systemctl restart` returns at fork, so the k8s-services and k8s-nats tests wait for `SubState=exited` where they relied on either. Closes #6937
This commit is contained in:
parent
da53e19636
commit
e8dc0ebac4
1 changed files with 80 additions and 7 deletions
|
|
@ -106,13 +106,21 @@ in
|
|||
];
|
||||
# ./lib/store-retry.nix: the login fails for as long as the store is
|
||||
# sealed or down.
|
||||
#
|
||||
# `Type = "simple"`, as `hyperhive-k8s-ca-trust` is (./runtime.nix):
|
||||
# the start job is done once the script has forked. A oneshot's
|
||||
# start job stays pending through its restarts, so a boot or a
|
||||
# switch with the store sealed held `multi-user.target` and
|
||||
# `switch-to-configuration` for the whole retry budget. Nothing
|
||||
# orders after this unit. `RemainAfterExit` keeps it `active
|
||||
# (exited)` once the credential is out, so `SubState=exited` is the
|
||||
# state that says so: `is-active` is true while the script still runs.
|
||||
inherit (storeRetry) startLimitBurst startLimitIntervalSec;
|
||||
serviceConfig = storeRetry.serviceConfig // {
|
||||
Type = "oneshot";
|
||||
Type = "simple";
|
||||
RemainAfterExit = true;
|
||||
UMask = "0077";
|
||||
SyslogIdentifier = "swarm-bao-store-auth";
|
||||
TimeoutStartSec = "15min";
|
||||
};
|
||||
environment = {
|
||||
BAO_ADDR = "https://${baoCfg.domain}:${toString baoCfg.port}";
|
||||
|
|
|
|||
Loading…
Reference in a new issue