cmd/k8s-operator: support custom TLS Secrets on Ingress#2
Draft
cmd/k8s-operator: support custom TLS Secrets on Ingress#2
Conversation
Add support for the tailscale.com/accept-app-caps annotation on Ingress resources. This populates the AcceptAppCaps field on HTTPHandler entries in the serve config, which causes the serve proxy to forward matching peer capabilities in the Tailscale-App-Capabilities header to backends. The annotation accepts a comma-separated list of capability names (e.g. "example.com/cap/monitoring,example.com/cap/admin"). Each capability is validated against the standard app capability regex. Invalid capabilities are skipped with a warning event, consistent with the operator's soft-validation pattern. Both the standard Ingress reconciler and the HA (ProxyGroup) Ingress reconciler benefit from this change since they share the same handlersForIngress() function. Updates #tailscale/corp#28049 Signed-off-by: matthalp <mhalpern@column.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
e8dd7a2 to
0cdbe23
Compare
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.
Why
We want the Kubernetes operator to serve custom HTTPS hostnames like
zerg.zergrush.devwhile preserving the existing MagicDNS/Tailscale hostname path and theTailscale-*identity model for ingress backends. That lets zergrush move web traffic onto operator-managed custom TLS without keeping a long-lived custom gateway in zergrush itself.What changed
tailscale/tailscale#18636sotailscale.com/accept-app-capsworks on both standard and ProxyGroup-backedIngressresourcesIngress.spec.tls[0].secretNameas a custom TLS certificate source for operator-managed ingress, copying the custom cert into proxy state secrets so the proxy can terminate that hostname directlyzerg.tail0a469.ts.netkeeps working whilezerg.zergrush.devis introducedipnlocalVIP service routing to match exact custom HTTPS hostnames before falling back to the service's MagicDNS FQDNTest plan
./tool/go fmt ./cmd/k8s-operator ./ipn/ipnlocal./tool/go test ./cmd/k8s-operator ./ipn/ipnlocal./tool/go test ./cmd/k8s-operator/...Revertibility
Safe to revert. The changes are limited to operator/runtime ingress behavior and tests; reverting restores the previous Tailscale-managed certificate behavior for ingress resources.
~ written by Zerg 👾