Extend LE *.unkin.net wildcard to arrstack + authentik (reflect into gitea) #418
Reference in New Issue
Block a user
Delete Branch "benvin/wildcard-consumers"
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
#417 stood up the central Let's Encrypt
*.unkin.netwildcard (Certificatewildcard-unkin-netincert-manager, secretwildcard-unkin-net-tls, emberstack-reflected). This wires the remaining single-label public hosts onto that publicly-trusted leaf instead of the internal Vault-PKI CA.A
*.unkin.netwildcard matches single-label subdomains only, so cluster hostnames under*.k8s.syd1.au.unkin.netare deliberately left onvault-issuer.How
wildcard-unkin-net-tlsintoarrstack,authentik,gitea(appended to both reflector namespace lists →cheeztv,arrstack,authentik,gitea).arrproxygateway listener (arrstack.unkin.net)certificateRefs→wildcard-unkin-net-tls; drop itscert-manager.io/*vault-issuer annotations.identity.unkin.nethttps listener →wildcard-unkin-net-tls. Theidentity.k8s.syd1.au.unkin.netlisteners keepauthentik-tls(vault-issuer), so the gatewaycommon-nameis retargeted to that cluster host.authentik-ldapgateway untouched.git.unkin.netcutover deferred (no manifest change), same deferred pattern as fafflix.Validation
kustomize buildOK for cert-manager / arrstack / authentik / gitea overlays.kubeconformall valid (0 invalid, 0 errors) across the four overlays.*.k8s.syd1.au.unkin.netlistener lost its vault-issuer wiring.Review finding (critical):
apps/base/authentik/gateway.yamlThe
authentikGateway still carries the Gateway-level annotationswhile now also having a listener (
https, hostnameidentity.unkin.net) whosecertificateRefspoints atwildcard-unkin-net-tls— the secret that's supposed to be populated only by the emberstack reflector from the centrally-managed LECertificateincert-managerns.cert-manager's gateway-shim creates one
Certificateobject per distinct secretName referenced by any listener in the Gateway, and Gateway-level issuer/common-name annotations apply to all of them — there's no per-listener opt-out (confirmed against the gateway-shim docs: it explicitly creates a separateCertificate"since two Secret names are used", and shared annotations apply across all generated Certificates). So this Gateway will also cause cert-manager to mint and own a second, competingCertificateforwildcard-unkin-net-tlsin theauthentiknamespace, issued offvault-issuer(internal Vault PKI) instead of the real LE wildcard.That fights the emberstack reflector for ownership of the same secret name/namespace: whichever controller reconciles last wins, so
identity.unkin.net's public TLS can flip between the real LE wildcard cert and an untrusted internal Vault-PKI leaf — defeating the point of this PR and potentially breaking public HTTPS onidentity.unkin.netintermittently.The
arrstackgateway in this same PR avoided exactly this by removing thecert-manager.io/*annotations entirely (its Gateway no longer needs any vault-issued cert).authentik's Gateway still needs a vault-issued cert for the internal listener (identity.k8s.syd1.au.unkin.net→authentik-tls), so the annotations can't just be dropped wholesale — but leaving them at the shared Gateway level while also referencing the wildcard secret from another listener in the same object re-introduces the hazard.Suggested fix: split into two
Gatewayobjects — one with nocert-manager.io/*annotations servingidentity.unkin.netonwildcard-unkin-net-tls(mirroring the arrstack pattern), and a second retainingcluster-issuer: vault-issuer/common-name: identity.k8s.syd1.au.unkin.net, serving only the internal hostname onauthentik-tls.(Side note, resolved fine: the
authentik-tlscert's own CN/SAN transition — droppingidentity.unkin.netfrom its SAN list and retargeting CN toidentity.k8s.syd1.au.unkin.net— is not itself a problem; no remaining listener needs the old SAN from that secret, and gateway-shim will reconcile/re-issue it automatically.)Everything else in the PR looks correct: wildcard
Certificate's reflector namespace lists are exactlycheeztv,arrstack,authentik,giteaon bothreflection-allowed-namespacesandreflection-auto-namespaceswith nothing else changed in that file;arrstackgateway cleanly repointed with no dead references toarrproxy-gateway-tlsleft anywhere in the repo;authentik-ldapgateway untouched (and uses TLSPassthroughonly, so it's unaffected by gateway-shim regardless); gitea has zero manifest changes (reflect-only, as intended); no*.k8s.syd1.au.unkin.netlistener lost its vault-issuer wiring. CI is green onfffc14f.Split authentik into a public wildcard gateway (identity.unkin.net -> wildcard-unkin-net-tls, no cert-manager annotations) plus an internal vault-issuer gateway (identity.k8s.syd1.au.unkin.net -> authentik-tls, common-name on the cluster host) per review, mirroring the cheeztv two-gateway pattern. HTTPRoutes re-parented per hostname; external-dns preserved per host (both target 198.18.200.4). kustomize build + kubeconform pass (35 valid, 0 errors).
public identity gateway moved to traefik-external (no external-dns annotations), matching the arrproxy external gateway convention
identity-dns-internal repointed to the external traefik VIP 198.18.199.0 (gateway moved to traefik-external); watchstate added to wildcard reflector lists for its upcoming external gateway