watchstate: expose externally at watchstate.unkin.net #420
Reference in New Issue
Block a user
Delete Branch "benvin/watchstate-external"
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?
Why
WatchState currently only has an internal front door (watchstate.k8s.syd1.au.unkin.net, PR #419, merged). This adds a public front door at watchstate.unkin.net via the external (DMZ) Traefik so the admin UI is reachable off-cluster, still fully gated by oauth2-proxy/Authentik. The internal gateway and routes are untouched; oauth2-proxy now fronts BOTH hostnames.
Stacked base note: the intended base (benvin/watchstate-deploy, PR #419) merged into main before this PR opened, so this targets
main.How
watchstate-dns-internalDNSRecord inapps/base/bind-internal/authoritative/records.yaml(unkin.net zone, bind-internal) ->A 198.18.199.0, the traefik-external VIP. Mirrors thearrstack-dns-internalprecedent (external front door via bind, not external-dns). Kept in the central bind-internal location, so no AppProject destination widening is needed.watchstate-externalGateway (gatewayClassName: traefik-external), http + https listeners on hostnamewatchstate.unkin.net. TLS terminated with the Let's Encrypt*.unkin.netwildcard secretwildcard-unkin-net-tls— so no cert-manager and no external-dns annotations.watchstate-external-http-redirect(http->https 301) andwatchstate-external(https ->watchstate-oauth2:80), mirroring the arrproxy/cheeztv external patterns.OAUTH2_PROXY_REDIRECT_URLchanged from the pinned cluster callback to the relative/oauth2/callback. WithOAUTH2_PROXY_REVERSE_PROXY=true(already set), oauth2-proxy derives scheme+host per request fromX-Forwarded-Proto/Host(verified in oauth2-proxy v7.15.3getOAuthRedirectURI: host-less redirectURL falls through to request-derived), so the callback works on bothwatchstate.unkin.netandwatchstate.k8s.syd1.au.unkin.net.COOKIE_DOMAINSandWHITELIST_DOMAINSnow list both hosts (one cookie per host; a single parent-domain cookie can't cleanly span unkin.net vs k8s.syd1.au.unkin.net).argocd.argoproj.io/sync-wave: "0"annotation on thedefaultVaultAuth. New resources intentionally carry no sync-wave annotations.Validation
kustomize build --enable-helmonapps/overlays/au-syd1/watchstateand.../bind-internal: OK.watchstate-dns-internal).Dependencies
wildcard-unkin-net-tlsinto thewatchstatenamespace. This PR references that secret as if present.https://watchstate.unkin.net/oauth2/callbackandhttps://watchstate.k8s.syd1.au.unkin.net/oauth2/callbackas redirect URIs on the watchstate provider.931bfcf923to47f7cd9c51