Watch
0
0
Fork
You've already forked hyperhive
0

require k8s: swarm services with a pod run in the cluster only

This commit is contained in:
atlas 2026-11-26 00:36:09 +01:00 • committed by maia
commit 57d40ae8ea

View file

@ -30,24 +30,27 @@ let
# poller defaults on, beside authelia, the publisher and the collector.
allLocal = shared.allLocal;
svc = allLocal.systemd.services.swarm-ci-metrics;
svc = allLocal.services.hyperhive.deploy.ci-metrics.unit;
timer = allLocal.services.hyperhive.deploy.ci-metrics.timer;
env = svc.environment;
clientId = allLocal.services.hyperhive.swarm.ci-metrics.clientId;
otel = allLocal.services.hyperhive.swarm.otel;
cases = [
{
# The control is the same unit and timer on the all-local host: a
# misspelled attribute path would make the absence arm pass alone.
name = "the CI run poller's unit and timer exist only where its host enables it";
# The unit and timer are the source of the poller's CronJob: the host runs
# neither. The unit and timer options are the control that the lookups find
# what the host does not have.
name = "the CI run poller's unit and timer are the source of its CronJob and the host runs neither";
ok =
!(bare.systemd.services ? swarm-ci-metrics)
&& !(bare.systemd.timers ? swarm-ci-metrics)
&& !(allLocal.systemd.services ? swarm-ci-metrics)
&& !(allLocal.systemd.timers ? swarm-ci-metrics)
&& allLocal.services.hyperhive.deploy.ci-metrics.enable
&& svc.serviceConfig.Type == "oneshot"
&& !(svc.serviceConfig.RemainAfterExit or false)
&& allLocal.systemd.timers.swarm-ci-metrics.timerConfig.OnUnitInactiveSec == "5min"
&& lib.elem "timers.target" allLocal.systemd.timers.swarm-ci-metrics.wantedBy;
&& timer.timerConfig.OnUnitInactiveSec == "5min"
&& lib.elem "timers.target" timer.wantedBy;
}
{
# The leaf is handed in as a credential, never an argument; the forge
@ -83,16 +86,13 @@ let
# without the bundle every pass fails `UnknownIssuer`. hive-c0re's
# bundle on the bare host is the control that the absence arm looks up
# a unit name the module would write.
name = "the poller trusts the swarm's CA through its own bundle, which exists only where the poller does";
name = "the poller trusts the swarm's CA through its own bundle, which the pod builds and the host does not run";
ok =
allLocal.services.hyperhive.gateway.useSelfSigned
&& (env.SSL_CERT_FILE or null) == "/run/swarm-ci-metrics-ca/trust-bundle.pem"
&& lib.elem "swarm-ci-metrics-ca-bundle.service" svc.requires
&& lib.elem "hive-tls-ca.service" (
allLocal.systemd.services.swarm-ci-metrics-ca-bundle.requires or [ ]
)
&& bare.systemd.services ? hive-c0re-ca-bundle
&& !(bare.systemd.services ? swarm-ci-metrics-ca-bundle);
&& !(allLocal.systemd.services ? swarm-ci-metrics-ca-bundle);
}
{
name = "the poller's client is registered as a machine, and the mint stores its secret";