Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/nix/host-modules/lib/bao-pod-auth.nix
maia 6acf1012cb swarmctl setup status: show the pending bootstrap re-run for the pods' login
`swarm-bao-k8s-jwt-policy` exits 0 when the bootstrap token lacks
`sys/auth/jwt-k8s`, so a store set up before the node looked fine in
`swarmctl setup status`: the unit is active and nothing marks the root-only
`swarmctl bao grant-bootstrap` re-run as pending.

The unit now keeps /run/swarm-bao-k8s-jwt-pending while it stays off and
removes it before it writes the mount's config. `setup status` reads the file
and shows step 3, "granter bootstrapped", as not done, naming the verb.
`module-eval-k8s` pins the order of the touch, the exit and the removal.
2026-11-27 18:07:59 +01:00

23 lines
956 B
Nix

# What the secret store's pod login and the pods' manifests agree on, in one
# place: the auth mount, the audience, and where the projected token is
# mounted. ../swarm-bao.nix writes the mount and its roles from it and
# ../k8s/render.nix renders the pods from it. `DEFAULT_JWT_FILE` in
# swarm-secret-client/src/client.rs is `tokenFile`.
#
# Pure attrset — NOT a NixOS module.
{
# Named in ../bao-bootstrap-policy.hcl, which is a static file.
mount = "jwt-k8s";
# The `aud` the pods ask the API server for and the roles require, so a token
# minted for the Kubernetes API is no use here.
audience = "bao";
tokenDir = "/var/run/secrets/hyperhive/bao";
tokenFile = "/var/run/secrets/hyperhive/bao/token";
# Exists while `swarm-bao-k8s-jwt-policy` waits for the root-only re-run of
# `swarmctl bao grant-bootstrap`. `PENDING_MARKER` in swarmctl/src/setup.rs
# is the same path.
pendingMarker = "/run/swarm-bao-k8s-jwt-pending";
}