Point identity env provider at in-cluster authentik-server ClusterIP #24
Reference in New Issue
Block a user
Delete Branch "benvin/incluster-provider-url"
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
The authentik terraform provider races against itself when the API is served by multiple replicas behind a load balancer: a write lands on one replica and the immediate read-back can hit another replica that has not yet observed it (goauthentik/terraform-provider-authentik#954). Going through identity.k8s.syd1.au.unkin.net (gateway -> 3 server replicas) exposes exactly that. Companion to the argocd-apps PR adding
sessionAffinity: ClientIPto the authentik-server Service — together, in-cluster runs pin to a single replica and the race disappears.Changes
urlasvar.authentik_url, defaulting to the environment's public URL (https://<env dir>) so other/new environments are unchangedauthentik_urlfor identity.k8s.syd1.au.unkin.net tohttp://authentik-server.authentik.svc.cluster.local(the HTTPRoute backends this Service on port 80 plain HTTP, so no TLS/CA knobs needed)Trade-off: local runs
CI plans/applies run in-cluster and resolve svc DNS fine, but local workstation runs (e.g. import recoveries) cannot resolve
*.svc.cluster.localand would fail to reach the API. Terragrunt does not override already-setTF_VAR_*env vars, so local runs work by exporting:(The provider's
AUTHENTIK_URLenv var does not help here since the provider block setsurlexplicitly.)