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:
parent
9d9757c153
commit
6be1b59ffc
1 changed files with 1106 additions and 96 deletions
11
nix/host-modules/lib/k8s-join-token.nix
Normal file
11
nix/host-modules/lib/k8s-join-token.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# What the k3s server and a node that joins it agree on about the join token:
|
||||
# the leaf of the swarm secret store the server's unit writes it to
|
||||
# (../k8s/join.nix) and the file the joining node's unit lands it in, which k3s
|
||||
# reads as its token. ../swarm-bao.nix grants the hives' identities a read of
|
||||
# the leaf.
|
||||
{
|
||||
# Under KV v2's `secret/` mount, as `bao kv` takes it.
|
||||
leaf = "swarm/services/k8s/agent-token";
|
||||
# On the node that joins. A tmpfs, so the token is fetched again at boot.
|
||||
file = "/run/k3s-join/token";
|
||||
}
|
||||
Loading…
Reference in a new issue