k3s custom CAs from OpenBao + pre-generated join token #11
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lab/machine-configs#11
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of lab/machine-configs#7.
Facts (docs.k3s.io/cli/certificate)
service.key.What
pki-k3s-<cluster>before first boot; deliver keys to server nodes via the OpenBao Agent.Done when
k3s certificate checkchains to the lab rootNaming: per mc#9 (rewritten 2026-11-11) the mount is pki-cluster-, not pki-k3s-. CA set generator: scripts/pki-ceremony-2.sh (
cebf33c) writes client/server/request-header/etcd-peer/etcd-server CAs (pathlen 0, chain = CA + lab root, no k3s intermediate layer), root-ca.pem, service.key and a K10 full-format token to OpenBao KV infra/k3s/. Harness must confirm k3s accepts the set without intermediate-ca.*.2026-11-11: the CA set generator is
scripts/pki-cluster-ca.sh <cluster>(5c7cfd5). It writes OpenBao KVinfra/k3s/<cluster>with k3s file names as keys:{client,server,request-header}-ca.{crt,key,pem},etcd/{peer,server}-ca.{crt,key,pem},root-ca.pem,service.key,token. CAs are signed by pki-issue (pathlen 0) with DNS name constraints frompki/clusters/<cluster>.domains.*.crt= CA + pki-issue + root. No k3s intermediate-ca layer.Harness checklist added by this design:
intermediate-ca.*k3s certificate checkplus a TLS handshake per componentOpen, decide before minting think's set: name constraints pin node hostnames. A new node whose name isn't in
think.domainsfails validation, so adding one means rotating the cluster CAs. Recommended fix at the #14 rebuild: node names under the cluster zone (--node-name think-01.think.int.animeteamspeak.moe), so onethink.int.animeteamspeak.moeconstraint covers every future node.2026-11-11: c1 CA set minted (scripts/pki-cluster-ca.sh c1) into OpenBao KV infra/k3s/c1, version 1. Verified from the stored certs: all five CAs pathlen 0, name constraints localhost / kubernetes / c1.caosh.int.animeteamspeak.moe, chain CA + pki-issue + root, Go verifies each against pki/root.crt. Token pin (sha256 of server-ca.crt): f1c089764e97f04d1f990c105741a33323ad2b564679160dfe5a25a353680f0c.
Note: the CAs expire 2031-11-10. OpenBao caps them at pki-issue's own expiry, so the requested 3700 days doesn't apply. Plan a same-root CA rotation before then; pki-issue renewal is a Nano session anyway.
2026-11-11: c1 CA set RE-MINTED (v1 deleted: it lacked
kubernetes.default,kubernetes.default.svc,kine.sockand the bare hostnames, so k3s would have rejected its own certs).Verified from the stored set:
scripts/x509-verify.go) verifies each againstpki/root.crt10c58cdeff8321b233d555d31f22a605d9d09ec29003681b429ab3b50f0bde4finfra/k3s/c1/joinholds onlytoken, identical to the main copyA new node joining c1 must first be added to
pki/clusters/c1.domains, followed by a same-root rotation (docs/k3s-ca-rotation.md).Done 2026-11-11, on main (38d405a..c6ba316). Fleet hosts evaluate unchanged; c1 switches on at #14.
cluster.pki.fromOpenbao: the agent renders CAs, service.key and the token from KVinfra/k3s/<c>(agents only/join); k3s seedsserver/tlsbefore its first start only.cluster.zone(cluster-domain plus<host>.<zone>node names),cluster.clusterInit, read-onlyk3s.nodeNameused by deploy-health/node-health.pki-cluster-ca.sh --rotate+scripts/k3s-rotate-ca.sh, docs/k3s-ca-rotation.md, rehearsed byvm:rotate-check(a pre-rotation service-account token still works).cluster.registryMirror: Harbor pull-through from KVinfra/harbor/node-pull(written by the harbor root, lab/iac #59/#60); registries.yaml is in the k3s fingerprint.kubernetes.default(.svc),kine.sockand each bare hostname). A new node means a domains edit plus rotation.Done-when:
k3s certificate checkchains to the lab rootHarness evidence: every stage green on fresh installs across runs; the last run (vm:e2e:quick on
57fb558) passed vm:check, vm:watchdog-check and vm:reboot-check.c6ba316(fingerprint) gets its harness proof on the next fresh vm:e2e.Follow-ups: #22 (flux-operator, blocks #14), #23 (hand-made harbor-config-openbao, state hygiene), #14 comment (hostname vs node-name call sites).