Repository navigation
staging hub-ha stage 1: leader election on the single hub - #118
Merged
Merged
Conversation
Fail-safe first stage: nothing selects on the new label yet, the Deployment stays one pod with Recreate. - hub pods carry app.kubernetes.io/component=hub and ztna.teknoir.org/hub-role (standby at start; the hub moves it), env POD_NAME, LEADER_ELECTION=wg-hub and the timings, HANDOVER_WAIT 0s with one replica (hub.replicas), 10s else. - new headless Service wg-hub-pods (UDP 51820, publishNotReadyAddresses, selector name + component=hub, so not the pull secret pods). - RBAC: Lease create and get/update on wg-hub, pods get/patch. - admission: ztna-workloads lets the hub SA UPDATE a hub pod, changing only the hub-role label (leader|standby) and the pod-deletion-cost annotation (0|100); new ztna-hub-lease reserves the Lease to the hub (and teardown). - stunner: the UDPRoute lists wg-hub and wg-hub-pods. - tests: unittest asserts, run.sh structural sets, vap-test.sh (hub allowed only on the two keys of hub pods; other labels, annotations, image, ownerReferences, finalizers, pull secret pods, lookalike pod, Backstage and others denied; Lease hub-only). hub.image.tag is not changed: the pin follows the wg-tunnel merge. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…lection Review fixes for hub-ha stage 1: the hub only patches its own pod, so drop get from the pods rule (it could read the spec of other teknoir-ztna pods). Note at the image pin that it must be replaced by a leader-election build before release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…derElection pin flag A k3s API outage over renewDeadline makes the only hub lose its lease and drop all sessions; vpro k3s restarts take a minute or two. The timings now outlast that. hub.image.leaderElection records that the pin carries leader election (gate in stage 2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wg-tunnel #8 (b563d89): leader election, role label, planned handover. leaderElection: true goes with this pin (the image sets the hub-role label). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Anders 2026-10-22: "Hub HA on staging".
Stage 1 of active-passive hub HA (plans/ztna-later.md hub-ha): wg-hub sha-b563d89 (wg-tunnel #8) with LEADER_ELECTION, a Lease, a hub Role that patches the pod role label, and a wg-hub-pods Service; still one replica. Expect one last ~1.5 min device blip (the old image has no handover). Gate before stage 2: the pod shows hub-role=leader and holds the lease.
charts/ztna/tests/run.sh and scripts/tests/run.sh green; Opus reviews clean.
🤖 Generated with Claude Code