tailscale/cmd/containerboot
Tom Meadows 5eb0b4be31
cmd/containerboot,cmd/k8s-proxy,kube: add authkey renewal to k8s-proxy (#19221)
* kube/authkey,cmd/containerboot: extract shared auth key reissue package

Move auth key reissue logic (set marker, wait for new key, clear marker,
read config) into a shared kube/authkey package and update containerboot
to use it. No behaviour change.

Updates #14080

Signed-off-by: chaosinthecrd <tom@tmlabs.co.uk>

* kube/authkey,kube/state,cmd/containerboot: preserve device_id across restarts

Stop clearing device_id, device_fqdn, and device_ips from state on startup.
These keys are now preserved across restarts so the operator can track
device identity. Expand ClearReissueAuthKey to clear device state and
tailscaled profile data when performing a full auth key reissue.

Updates #14080

Signed-off-by: chaosinthecrd <tom@tmlabs.co.uk>

* cmd/containerboot: use root context for auth key reissue wait

Pass the root context instead of bootCtx to setAndWaitForAuthKeyReissue.
The 60-second bootCtx timeout was cancelling the reissue wait before the
operator had time to respond, causing the pod to crash-loop.

Updates #14080

Signed-off-by: chaosinthecrd <tom@tmlabs.co.uk>

* cmd/k8s-proxy: add auth key renewal support

Add auth key reissue handling to k8s-proxy, mirroring containerboot.
When the proxy detects an auth failure (login-state health warning or
NeedsLogin state), it disconnects from control, signals the operator
via the state Secret, waits for a new key, clears stale state, and
exits so Kubernetes restarts the pod with the new key.

A health watcher goroutine runs alongside ts.Up() to short-circuit
the startup timeout on terminal auth failures.

Updates #14080

Signed-off-by: chaosinthecrd <tom@tmlabs.co.uk>

---------

Signed-off-by: chaosinthecrd <tom@tmlabs.co.uk>
2026-04-15 16:13:46 +01:00
..
egressservices_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
egressservices.go cmd/containerboot: fix error handling for egress (#18657) 2026-02-10 10:19:06 +00:00
forwarding.go all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
ingressservices_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
ingressservices.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
kube_test.go cmd/containerboot,cmd/k8s-proxy,kube: add authkey renewal to k8s-proxy (#19221) 2026-04-15 16:13:46 +01:00
kube.go cmd/containerboot,cmd/k8s-proxy,kube: add authkey renewal to k8s-proxy (#19221) 2026-04-15 16:13:46 +01:00
main_test.go cmd/containerboot: mark TestContainerBoot as flaky 2026-04-13 15:21:42 -07:00
main.go cmd/containerboot,cmd/k8s-proxy,kube: add authkey renewal to k8s-proxy (#19221) 2026-04-15 16:13:46 +01:00
serve_test.go cmd/containerboot,kube: enable autoadvertisement of Tailscale services on containerboot (#18527) 2026-02-20 15:52:34 -08:00
serve.go cmd/containerboot,kube: enable autoadvertisement of Tailscale services on containerboot (#18527) 2026-02-20 15:52:34 -08:00
settings_test.go cmd/containerboot: handle v6 pod ips that are missing square brackets (#18519) 2026-02-03 11:16:59 +00:00
settings.go cmd/vet: add subtestnames analyzer; fix all existing violations 2026-04-05 15:52:51 -07:00
tailscaled.go cmd/containerboot,kube: enable autoadvertisement of Tailscale services on containerboot (#18527) 2026-02-20 15:52:34 -08:00
test_tailscale.sh cmd/containerboot: make a tests table, add more tests. 2022-11-10 09:14:27 -08:00
test_tailscaled.sh cmd/containerboot: avoid leaking bash scripts after test runs 2023-09-21 13:17:48 -07:00