Skip to content

fix(k8s): argo cd takes homelab values from deploy-time overrides, and the repository holds no private or placeholder config #1290

Closed

Description

@dan-petty

Problem

#1281 (3f02ee9) tried to keep homelab values out of this public repository with a gitignored .argocd-source.yaml generator (src/devops_cli/k8s/argocd_source.py, devops k8s argocd-source). Argo CD reads .argocd-source.yaml only from the Git repository at the Application's path: repo-server checks out its own clone and runs git clean -ffdx, so a gitignored copy is never seen [sourced: https://argo-cd.readthedocs.io/en/stable/user-guide/parameters/#store-overrides-in-git; argoproj/argo-cd v3.5.3 reposerver/repository/repository.go, util/git/client.go].

To compensate, #1286-#1289 added kubectl apply of the rendered ConfigMap and Ingresses and a fail-open kubectl patch of the live Applications. Argo CD's self-heal reverts the applied objects, because Git declares them, and nothing stops the cluster app-of-apps from reverting the patches. The branch also tracks a placeholder k8s/devops/configmap.yaml (owner/repo, devops-bot), which the devops Application enforces over the ConfigMap that deploy-stack renders from the active config.

If release/v0.2.28 merged into main as it stands, cluster would retarget every Application to main:

  • the ingress Application would rewrite every Ingress host to *.example.com, so the routes stop matching;
  • the devops Application would start roadmap-service on the placeholder config.

Acceptance criteria

  • The repository holds no homelab value and no devops-cli ConfigMap. k8s/devops/configmap.yaml is deleted, gitignored and unlisted, and k8s/devops/configmap.example.yaml stays as the template. The renderer has no placeholder fallback, and AppProject homelab ignores the ConfigMap among its orphaned resources.
  • devops k8s deploy-stack renders ConfigMap devops-cli-config from the active config and applies it, on native and Argo CD-managed clusters alike. It exits non-zero when rendering or applying fails, and no Argo CD Application owns the ConfigMap. teardown-stack --stack devops deletes it.
  • On an Argo CD-managed cluster, deploy-stack sets the hostnames derived from the configured domain as spec.source.kustomize.patches on the Applications devops and ingress.
    • The hosts come from what each Application renders at its targetRevision, fetched from its repoURL, never from the local checkout. --argocd-revision <ref> stages another revision before a release merges.
    • Every patch tests the placeholder value before replacing it.
    • A failure exits non-zero, and deploy-stack applies no Ingress itself.
  • deploy-stack renders and derives everything before it writes anything, so an unset setting changes nothing. Its dry run lists the ConfigMap and the overrides, runs nothing, and refuses like the deploy.
  • k8s/argocd/bootstrap/cluster.yaml ignores /spec/source/kustomize on those two Applications and syncs with RespectIgnoreDifferences=true, so the cluster app-of-apps keeps the overrides.
  • Removed: the .argocd-source.yaml generator, devops k8s argocd-source, the .argocd-source*.yaml gitignore lines and the stdin Ingress applies. No test or test fixture writes k8s/devops/configmap.yaml.
  • k8s/README.md explains which values are supplied at deploy time, which stack supplies each one, the bootstrap and recovery steps, and the release-merge steps.
  • (person-run) Right before the release merges, run uv run devops k8s deploy-stack --stack devops --argocd-revision release/v0.2.28. After the merge, wait for the service:v0.2.28 image, then restart roadmap-service and check the Ingress hosts and the devops-cli-config ConfigMap. The task file lists the commands.
  • changelog.d/<n>.md records the change; CHANGELOG.md and docs/ROADMAP.md are not edited.
  • uv run devops ci passes.

Key questions

Strategic alignment

Activity

  1. added this to the v0.2.28 milestone on Oct 7, 2026
  2. added
    type/bug
    scope/k8s
    priority/p0-critical
    on Oct 7, 2026
  3. dan-petty-bot commented on Oct 7, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item kept in v0.2.28: it was already in v0.2.28.

    • Priority: P0-Critical. P0: the regression commit 3f02ee9 is evidence GitHub confirms, from a trusted source.
    • Value: High. Prevents a live-cluster outage (broken routes, placeholder config) and removes placeholder private values from the public repository.
    • Effort: High. Requires rewriting the deploy-stack flow, updating Argo CD bootstrap manifests with ignoreDifferences, removing the old generator and compensating kubectl steps, updating tests and docs, plus a manual pre-merge verification.
  4. modified the milestones: v0.2.28, v0.2.29 on Oct 7, 2026
  5. dan-petty-bot commented on Oct 7, 2026

    @dan-petty-bot
    Collaborator

    Moved to v0.2.29: v0.2.28 is cut, so nothing joins it until its release pull request is closed; a critical fix goes first into the next release. (devops roadmap reprioritize)

  6. dan-petty-bot commented on Oct 7, 2026

    @dan-petty-bot
    Collaborator

    What changed

    #1292, merged into release/v0.2.28 as 5c45b1e.

    Closes #1290

    36 file(s) changed.

    How it was verified

    Check runs at 72ce195:

    • Prune PR DevContainer Images: pass
    • CodeQL: pass
    • Static Analysis: pass
    • Analyze (actions): pass
    • Analyze (python): pass
    • Tests & Coverage: pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1290-argocd-deploy-time-overrides.md:

    • The repository holds no homelab value and no devops-cli ConfigMap; k8s/devops/configmap.yaml is deleted, gitignored and unlisted (tests/test_k8s_argocd_apps.py).
    • deploy-stack renders ConfigMap devops-cli-config from the active config on native and Argo CD-managed clusters, and exits non-zero when rendering or applying it fails (tests/test_k8s.py, tests/test_k8s_configmap.py).
    • On an Argo CD-managed cluster, deploy-stack sets the hosts that each Application renders at its revision, or at --argocd-revision, as spec.source.kustomize.patches. It pushes Secrets only after deriving them, exits non-zero on failure, and applies no Ingress (tests/test_k8s.py).
    • Kustomize applies the generated patches to every host each Application renders, and fails the build when a host moved within its object (tests/test_k8s_argocd_overrides.py).
    • k8s/argocd/bootstrap/cluster.yaml ignores /spec/source/kustomize on both Applications with RespectIgnoreDifferences=true, neither Application declares that field in git, and AppProject homelab ignores the orphaned ConfigMap (tests/test_k8s_argocd_apps.py).
    • The dry run reports the ConfigMap and the host overrides and runs nothing, and teardown-stack deletes the ConfigMap (tests/test_k8s.py).
    • A revision or repository value is never read as a git option, an Application that renders no placeholder host is refused, and a multi-source Application is refused by name (tests/test_k8s_argocd_overrides.py, tests/test_k8s.py).
    • The .argocd-source.yaml generator, its command, its gitignore lines and the stdin Ingress applies are removed; no test or fixture writes k8s/devops/configmap.yaml.
    • k8s/README.md describes the deploy-time values and the release-merge steps.
    • Pending a person (the one-time v0.2.28 cutover, while the live leaf Applications still track release/v0.2.27, whose overlays carry the real hosts): right before release/v0.2.28 merges into main, run uv run devops k8s deploy-stack --stack devops --argocd-revision release/v0.2.28 from a checkout of release/v0.2.28. Until the merge, Application ingress shows ComparisonError testing value /spec/rules/0/host failed, and the live Ingresses are unchanged. After the merge, roadmap-service waits for image service:v0.2.28 from the Release Orchestration workflow; once it is published, run kubectl -n devops rollout restart deploy/roadmap-service. Then run devops argo cd apps status devops, devops argo cd apps status ingress, kubectl get ingress,ingressroute -A -o yaml | grep example.com (prints nothing) and kubectl -n devops get configmap devops-cli-config -o yaml.
    • Release process: before feat(release): v0.2.28 #1283 merges, the v0.2.28 section of CHANGELOG.md takes this fragment and drops the fix(k8s): resolve argocd application out-of-sync and manifest generation failures #1279 entry that adds devops k8s argocd-source, through a chore/open-v0.2.28-<slug> pull request as fix(review): remediate copilot review comments and collate changelog for v0.2.28 #1284 did for 1279.md.
  7. modified the milestones: v0.2.29, v0.2.28 on Oct 7, 2026
  8. dan-petty commented on Oct 7, 2026

    @dan-petty
    OwnerAuthor

    Back in v0.2.28 by the owner's decision (2026-10-07): the release branch holds every change v0.2.28 needs before its release pull request (#1283) merges. This is a critical fix for a regression introduced in this release by 3f02ee9 (#1281). Without it, merging #1283 retargets the Applications to main, where every Ingress host renders as *.example.com and roadmap-service starts on placeholder config. The reprioritize rule that sends a critical fix to the next release while the release pull request is open is filed separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p0-criticalscope/k8stype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions