Watch
0
0
Fork
You've already forked hyperhive
0

let a second machine join the main node's k3s and run pods from images only the main node holds

This commit is contained in:
atlas 2026-11-25 22:36:35 +01:00 • committed by mara
commit 6be1b59ffc

View file

@ -45,6 +45,7 @@ let
# about the pods' login.
k8sNode = deployCfg.k8s;
podAuth = import ./lib/bao-pod-auth.nix;
k8sJoinToken = import ./lib/k8s-join-token.nix;
shared = import ./lib/swarm-bao-shared.nix { inherit config lib pkgs; };
inherit (shared)
@ -920,7 +921,10 @@ let
}) hyperhiveCfg.swarm.hives;
# What a hive's gateway-leaf identity may do: issue from its own role, read
# two of its own cache facts, and read its own squid self-check credential.
# two of its own cache facts, read its own squid self-check credential, and
# read the k3s join token a node that joins fetches
# (./k8s/join.nix); the hive of this host, which runs the cluster's main
# node, also writes it.
# The root unit on the hive host (`hive-priv-cache-facts`,
# ./hive-priv-cache.nix) reads the facts under this identity: the key
# hive-priv's downloads must be signed by, and the token it pulls with. The
@ -941,6 +945,16 @@ let
"pull-token"
]
+ readStanza "${credentialMountPath}/data/swarm/hives/${obj.hiveName}/squid-selfcheck"
+ (
if k8sNode.enable && obj.hiveName == deployCfg.hive-controller.hiveName then
''
path "${credentialMountPath}/data/${k8sJoinToken.leaf}" {
capabilities = ["create", "read", "update"]
}
''
else
readStanza "${credentialMountPath}/data/${k8sJoinToken.leaf}"
)
# The archive credentials swarm-controller writes for the agents this hive
# places: the backup unit (./hive-archive-backup.nix) lists them and reads each.
+ readStanza "${credentialMountPath}/data/swarm/hives/${obj.hiveName}/archive/*"