feat: add Tailscale subnet router for k8s service CIDR #176
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-platform!176
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "175-tailscale-subnet-router"
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?
Summary
10.43.0.0/16to the tailnetautoApproversto ACL sotag:k8snodes' subnet routes are auto-approvedChanges
terraform/main.tf: Addedkubernetes_manifest.tailscale_subnet_router(Connector CRD, 24 lines)terraform/main.tf: AddedautoApprovers.routesblock totailscale_acl.this(7 lines)tofu plan output
Test Plan
tofu validatepassestofu plan -lock=falseshows 1 add, 1 changetofu applycreates subnet router podtailscale statusshowsk8s-subnet-routeradvertising10.43.0.0/16ping 10.43.50.207(Woodpecker ClusterIP) succeeds10.43.50.207:9000successfullyReview Checklist
tofu fmtandtofu validateRelated
project-capacitor-mobile— consumer of the Mac build agentPR #176 Review
DOMAIN REVIEW
Tech stack: OpenTofu / Terraform -- Tailscale ACL policy + Kubernetes CRD (Tailscale Connector). Two logical changes in one file (
terraform/main.tf), 33 additions, 0 deletions.Change 1:
autoApproversin ACL policy (lines 93-99)Correct placement inside the
tailscale_acl.thisresource'sjsonencodeblock. TheautoApprovers.routesstructure maps CIDR to tag owners, which is the documented Tailscale ACL schema. This ensures subnet routes advertised bytag:k8snodes are auto-approved without manual admin console intervention. Sound pattern -- eliminates a manual approval step that would break automation.Change 2:
kubernetes_manifest.tailscale_subnet_router(lines 113-131)tailscale.com/v1alpha1Connector CRD, which is the correct API version for the Tailscale k8s operator's subnet router feature.namespacein metadata is correct.depends_oncorrectly references bothhelm_release.tailscale_operator(CRD must exist before the CR) andtailscale_acl.this(auto-approver must be in place before routes are advertised). This ordering prevents a race where the route would be advertised but not auto-approved.hostnamefield gives the node a deterministic name in the tailnet (k8s-subnet-router), which aids operational visibility intailscale status.Observations on the CIDR
10.43.0.0/16:The CIDR
10.43.0.0/16appears in three places across the repo:salt/pillar/firewall.sls:26, the newautoApproversblock, and the newadvertiseRoutesblock. The two new occurrences in this PR are tightly coupled (they must match) and co-located in the same file 27 lines apart. Alocalwould be reasonable but is not a blocker given the tight proximity and the fact that the Salt pillar reference is in a different IaC domain entirely. The inline comments clearly label the value's purpose.No
field_managerblock needed: Unlike NetworkPolicy resources (fixed in PR #156), the Connector CRD is a brand-new resource with no pre-existing server-side state, so no field manager conflict is expected.BLOCKERS
None.
This is a pure infrastructure change (Terraform CRD + ACL policy). There is no application code, no user input, no secrets, no auth logic. The BLOCKER criteria do not apply:
tofu plan+ post-apply verification, which is documented in the Test Plan).NITS
Consider a
localsblock for the service CIDR:10.43.0.0/16appears twice in this PR (line 97 and line 124). Alocals { k8s_service_cidr = "10.43.0.0/16" }would create a single source of truth within the Terraform layer. Low priority given the co-location and clear comments.Connector CRD API version is
v1alpha1: This is the current correct version for the Tailscale operator, but alpha APIs can change without notice. Worth a comment or a pinned operator version check. The operator is already pinned at1.94.2(line 19), which mitigates this -- just noting for future upgrade awareness.SOP COMPLIANCE
175-tailscale-subnet-routermatches issue #175project-capacitor-mobilereferenced as the consumertofu fmtandtofu validateconfirmed passing (per PR checklist)tofu plan -lock=falseoutput included: "Plan: 1 to add, 1 to change, 0 to destroy"PROCESS OBSERVATIONS
depends_onordering is correct, the CRD is well-documented, and the ACL auto-approver is idempotent. Rollback is straightforward (tofu destroy -target=kubernetes_manifest.tailscale_subnet_router).tofu apply,tailscale status, and connectivity checks are correctly left unchecked (pre-merge). These should be verified after apply.VERDICT: APPROVED