Plan: AKS — Bring 02-post-apply.sh secrets-apply step to parity with bash
IMPLEMENTATION RULES: Before implementing this plan, read and follow:
- WORKFLOW.md - The implementation process
- PLANS.md - Plan structure and best practices
Status: Superseded (2026-05-16)
The auto-apply-inside-post-apply approach was not taken. Instead, secrets management is now a separate top-level CLI surface:
./uis secrets generate— renderskubernetes-secrets.ymlfrom templates./uis secrets apply— runskubectl apply -f kubernetes-secrets.ymlagainst the current context (implementation:provision-host/uis/lib/secrets-management.sh:204)
The user-facing flow after ./uis platform up azure-aks:
./uis platform up azure-aks # provisions + Traefik
./uis secrets apply # apply once after cluster is up
./uis deploy <service> # works
The edit-and-reapply path is documented in website/docs/contributors/architecture/secrets.md ("Normal commands" block, lines 125-136):
nano .uis.secrets/secrets-config/00-common-values.env.template
./uis secrets generate
./uis secrets apply
This PLAN is preserved in completed/ as a record of the design path; no further work is planned against 02-post-apply.sh's secrets step.
Goal: Add a kubernetes-secrets.yml apply step to platforms/azure-aks/scripts/02-post-apply.sh so that an AKS cluster provisioned via platforms/azure-aks/ is ready to receive the full UIS service catalogue (postgresql, authentik, openwebui, postgrest, etc.) — not just nginx. Brings the OpenTofu post-apply script into parity with the working bash precedent at hosts/azure-aks/02-azure-aks-setup.sh:125-141.
Last Updated: 2026-05-07
Investigation: INVESTIGATE-system-platform-provisioning-layer.md — gap-analysis finding #1 (kubernetes-secrets.yml not applied).
Prerequisite (soft): PLAN-001-aks-step1-verification.md — natural order is verify Step 1 first, then extend with this parity fix. Not a hard dependency: the change here is a no-op when kubernetes-secrets.yml doesn't exist (warns + continues), and nginx in PLAN-001's verification doesn't need secrets.
Problem Summary
platforms/azure-aks/scripts/02-post-apply.sh does five things today: merge kubeconfig, switch context, apply storage class aliases, install Traefik, wait for external IP. It does not apply kubernetes-secrets.yml to the cluster.
The bash precedent (hosts/azure-aks/02-azure-aks-setup.sh:125-141) does apply it, between storage classes and Traefik install. Without that step, almost every UIS service fails at deploy time on the AKS cluster — they expect the urbalurba-secrets secret object to exist in their target namespace.
The fix is mechanical: insert a parallel block in the OpenTofu post-apply script. ~15 lines of code, plus a one-line source of provision-host/uis/lib/paths.sh so the get_kubernetes_secrets_path helper is in scope (same as the bash version).