Watch
0
0
Fork
You've already forked hyperhive
0

k8s: the ca-trust publisher no longer holds multi-user.target while it waits for the setup

This commit is contained in:
atlas 2026-11-27 03:41:11 +01:00 • committed by mara
commit adbe85e427
2 changed files with 14 additions and 2 deletions

View file

@ -70,6 +70,10 @@ in
# A pod waits in ContainerCreating until this has run. The unit has no
# `RemainAfterExit`, so the path unit below starts it again whenever a
# file changes.
#
# `Type = "simple"`: the start job is done once the script has forked, so
# the unit never holds `multi-user.target`. The CA files come from the
# setup, which runs after boot, and the script waits for them.
(lib.mkIf (onCluster != [ ] && caFiles != { }) {
systemd.services.hyperhive-k8s-ca-trust = {
description = "publish the hive's CA files to the cluster's pods";
@ -80,7 +84,7 @@ in
"swarm-bao-pki.service"
];
serviceConfig = {
Type = "oneshot";
Type = "simple";
Restart = "on-failure";
RestartSec = "10s";
SyslogIdentifier = "hyperhive-k8s-ca-trust";

View file

@ -892,6 +892,9 @@ let
&& hasInfix "--from-file=swarm-services-root.pem=" caUnit.script
&& hasInfix "--from-file=trust-bundle.pem=" caUnit.script
&& lib.elem "multi-user.target" caUnit.wantedBy
# Not a oneshot: its start job would last until the script ends, and the
# script waits for files the setup writes after boot.
&& caUnit.serviceConfig.Type == "simple"
# A change to either file publishes again with no manual step, and the
# host without the node has no path unit.
&&