feat: let ArgoCD manage and upgrade its own install #97

Merged
ivuorinen merged 9 commits from ivuorinen/feat/argocd-self-management into main 2026-10-08 12:56:56 +00:00 AGit
Owner

Merge gate: the cluster still runs ArgoCD v3.5.3 and this pins v3.5.4. Before merging, run scripts/08-install-argocd.sh from current main, then re-run the render-vs-live diff (expect no differences). After the first sync shows Synced, run scripts/release-argocd-ownership.sh. Design: docs/superpowers/specs/2026-10-08-argocd-self-management-design.md

Merge gate: the cluster still runs ArgoCD v3.5.3 and this pins v3.5.4. Before merging, run scripts/08-install-argocd.sh from current main, then re-run the render-vs-live diff (expect no differences). After the first sync shows Synced, run scripts/release-argocd-ownership.sh. Design: docs/superpowers/specs/2026-10-08-argocd-self-management-design.md
argocd-config now applies upstream install.yaml at a pinned tag, with the three CRDs and two Secrets removed and our ConfigMaps merged onto upstream's. The built ConfigMaps equal the live ones key for key.

Upstream sets no container resources, which the kube-linter pre-commit hook reports once it builds this directory. Each ArgoCD workload carries an ignore-check annotation for the two checks instead: sizing the containers would restart every ArgoCD pod on the first sync.
applications and applicationsets are over the annotation size limit that ArgoCD's client-side CRD step writes. The hook applies all three before each sync of argocd-config, so new controllers never start against older CRDs.
The dashboard URL manager now also reads gitops/apps/argocd-config/, so the install URL and the CRDs' base URL move in one commit. A test fails if they name different tags.

The CRD Job writes its tagged URL once. Renovate's regex manager extracts identical matches as one dependency and rewrites only the first occurrence, so three tagged URLs would have left two on the old tag in every bump. The test also fails if a file holds the tagged URL more than once.
The generator reads the tag from argocd-config's install URL instead of keeping its own pin, and the generated-files hook now runs when that file changes.
08-install-argocd.sh reads the install URL from argocd-config's kustomization instead of pinning its own copy, which went stale in a checkout behind main and re-applied the old version. It is now for bootstrap and recovery only.
Its PreSync CRD hook runs as the crd-installer ServiceAccount that the crds Application creates. On a fresh cluster argocd-config can sync first, and autosync does not retry a failed revision by itself, so OIDC and RBAC would wait for the next commit. Same retry as the other Applications that depend on another one.

The header now describes what the Application manages: ArgoCD's install, not only its ConfigMaps.
Updated every sentence the change made false: docs/05-argocd.md (install, upgrade, recovery, the prune exception, and the pods/exec RBAC rule, which is now a kustomize patch rather than a hand patch the next sync reverts), docs/09-authentik.md (argocd-cm is built from install.yaml), the crds.yaml re-check note, the monitoring-targets header, the README layout line, CLAUDE.md's coupling list and the spec's status.

Left as they are, still true: the bootstrap order in docs/02-helm-arkade.md, docs/04-storage.md, scripts/run-all.sh and the README script table, which run 08-install-argocd.sh on a fresh cluster. docs/11-renovate.md had nothing about ArgoCD's pin.
feat: release kubectl's field ownership of ArgoCD once argocd-config adopts it
All checks were successful
validate / render (pull_request) Successful in 2m10s
validate / hooks (pull_request) Successful in 3m36s
b18b46ef15
08-install-argocd.sh applies as the field manager kubectl. When argocd-config applies the same objects with equal values, server-side apply makes the two co-owners rather than handing the fields over, and ArgoCD migrates only Update entries. A field a later ArgoCD release drops would then stay live, kept by kubectl, and ArgoCD's diff ignores fields that exist only live.

scripts/release-argocd-ownership.sh applies an identity-only copy of each built object as kubectl, which drops the fields kubectl alone owns and keeps those argocd-controller co-owns, so nothing restarts. It writes nothing unless argocd-config's last sync succeeded and argocd-controller already owns every object, then reads each object back and fails if kubectl still owns it. Run it after the first sync and after every run of the install script.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ivuorinen/turingpi-cluster!97
No description provided.