Deploy Authentik identity provider (C2 Mikado) #227

Merged
eblume merged 23 commits from feature/deploy-authentik into main 2026-02-20 12:56:00 -08:00

23 commits

Author SHA1 Message Date
7ac7c6a3e5 Decommission Dex: remove all references, replace with Authentik
- Delete dex manifests, ArgoCD app, container build, and reference doc
- Remove dex from Caddy reverse proxy config
- Create authentik.md reference doc
- Rewrite federated-login.md for Authentik architecture
- Update grafana, forgejo, ringtail, harden-zot-registry docs
- Update services-check: replace dex health/pod checks with authentik
- Fix all broken [[dex]] wiki-links

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 12:51:09 -08:00
25d43aa743 Fix blueprint !Env tag: use scalar not sequence
!Env expects a bare string (e.g. !Env FOO), not a YAML sequence
(!Env [FOO]). The list form caused IndexError during blueprint
discovery.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 12:22:01 -08:00
b3f30fd947 Bump authentik image to v1.1.2-nix (entrypoint blueprint fix)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 12:16:34 -08:00
3e3fe0b2eb Fix blueprint symlinks: use runtime entrypoint wrapper
All checks were successful
Build Container / build (push) Successful in 3s
Build Container (Nix) / build (push) Successful in 1m8s
extraCommands in buildLayeredImage can't access store paths from
contents (they're in separate layers), so the glob matched nothing.
Instead, create a wrapper entrypoint that symlinks built-in blueprint
dirs from the Nix store into /blueprints at container start. The
directory is created world-writable so user 65534 can create links.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 12:16:07 -08:00
746435a905 Bump authentik image to v1.1.1-nix (blueprint path fix)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 12:11:41 -08:00
b99c655c47 Fix blueprint loading: create /blueprints symlink dir in container
All checks were successful
Build Container / build (push) Successful in 2s
Build Container (Nix) / build (push) Successful in 1m9s
The nixpkgs authentik-django package hardcodes blueprints_dir to its
Nix store path, making custom blueprints mounted at /blueprints/custom
invisible to the discovery system. Add extraCommands to create a
/blueprints directory with symlinks to the built-in blueprint dirs,
and set AUTHENTIK_BLUEPRINTS_DIR=/blueprints so authentik scans the
unified directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 12:09:12 -08:00
9417bdb451 Mikado: document blueprint loading issue on Nix container
Nix-built authentik hardcodes blueprints_dir to the Nix store path.
Custom blueprints at /blueprints/custom/ are not discovered.
Need to override AUTHENTIK_BLUEPRINTS_DIR or patch the container.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 11:55:25 -08:00
00e4dc46e3 Migrate Grafana OIDC from Dex to Authentik
- Add Authentik Blueprint (ConfigMap) defining Grafana OAuth2 provider,
  application, admins group, and policy binding
- Mount blueprint in worker, pass grafana client secret via env
- Switch Grafana auth.generic_oauth from Dex to Authentik endpoints
- Replace dex-oauth ExternalSecret with authentik-oauth

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 11:47:17 -08:00
4e3f7bead7 Mikado: add migrate-grafana-to-authentik prerequisite
Authentik is deployed but no services use it yet. New leaf node
to migrate Grafana's OIDC from Dex to Authentik, then decommission Dex.
Goal card re-activated with new dependency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 11:19:34 -08:00
f144581ec2 Complete deploy-authentik goal — Authentik running on ringtail
Mikado chain complete: all three prerequisites resolved, Authentik
server/worker/Redis healthy on k3s, accessible at authentik.ops.eblu.me.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 11:02:36 -08:00
7300f72e18 Add authentik.ops.eblu.me to Caddy reverse proxy
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:59:25 -08:00
d90c993c6d Bump authentik image to v1.1.0-nix (adds coreutils)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:56:35 -08:00
41ee4161a9 Add coreutils to authentik container
All checks were successful
Build Container / build (push) Successful in 2s
Build Container (Nix) / build (push) Successful in 1m9s
The ak wrapper script requires mkdir (and likely other coreutils)
to create runtime directories.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:54:40 -08:00
8016427a3c Add Authentik deployment manifests and ArgoCD app
Server, worker, Redis deployments targeting ringtail k3s cluster.
ExternalSecret pulls config from 1Password "Authentik (blumeops)".
Tailscale Ingress exposes at authentik.tail8d86e.ts.net.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:51:38 -08:00
cbf08a7bde Complete provision-authentik-database and create-authentik-secrets leaf nodes
Both prerequisites for deploy-authentik are now satisfied:
- CNPG managed role + ExternalSecret for authentik DB user
- 1Password item "Authentik (blumeops)" with all required fields
- Database created and cross-cluster connectivity verified

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:23:48 -08:00
bddce1a159 Add authentik database user and ExternalSecret
Add managed role for authentik user on blumeops-pg CNPG cluster,
with ExternalSecret pulling password from 1Password item
"Authentik (blumeops)".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:20:23 -08:00
cc9ed2f2de Mikado: add push-after-every-iteration to git discipline
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:14:44 -08:00
8116d6294a Complete build-authentik-container leaf node
Image registry.ops.eblu.me/blumeops/authentik:v1.0.0-nix built
via Nix on ringtail and verified in zot registry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:12:50 -08:00
ac94cf6c5d Add Authentik container definition (Nix)
All checks were successful
Build Container / build (push) Successful in 3s
Build Container (Nix) / build (push) Successful in 1m57s
Nix-built container using pkgs.authentik with ak entrypoint.
Includes bashInteractive (ak is a bash wrapper), cacert, tzdata.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:09:17 -08:00
fdcb4d2ae3 Mikado: document build artifact and tag handling
Build artifacts (container images, git tags) are independent of branch
lifecycle and don't need to be deferred or reset during Mikado iterations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:08:52 -08:00
fbf230b414 Move Mikado cards to topic subdirectory, not plans/
Mikado cards are discovered through failed attempts, not designed
upfront — they don't belong in plans/. Cards now live where they
topically belong (how-to/authentik/ for this chain). Updated
agent-change-process to document this convention.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 09:53:07 -08:00
08ee70d6df Refine C2 Mikado method: failed attempt handling and early PRs
Lessons learned from first C2 attempt (deploy-authentik):
- When an attempt fails, reset code changes before committing cards
- Cherry-pick doc commits onto clean base if code/docs got mixed
- Open a PR early so the user can review the Mikado graph evolving

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 09:43:30 -08:00
a79a33eeed Mikado: identify three leaf prerequisites for Authentik deploy
Attempted deployment fails on three independent blockers:
1. Container image doesn't exist (build-authentik-container)
2. PostgreSQL database doesn't exist (provision-authentik-database)
3. 1Password secrets don't exist (create-authentik-secrets)

Created cards for each and added requires to goal card.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 09:40:09 -08:00