Skip to content

chore(k8s): bootstrap-gitops retires the helm release records of charts argo cd adopted, and no runbook runs helm against them #1644

Closed

Description

@dan-petty

Friction

Eleven charts that Argo CD now owns still have Helm release records marked deployed, frozen at their last native deploy on 2026-10-06 (traefik's at 2026-09-30), and every object carries both Helm's release annotations and Argo CD's tracking id. Old runbooks and the knowledge base agents read still say to run helm rollback or helm uninstall against these release names; doing so would roll back or delete objects Argo CD owns, and a chart-created PVC such as Prometheus's could go with its data. An AppProject orphan ignore keeps Argo CD from ever reporting the 112 leftover Secrets. Application prometheus-operator-crds has never synced, so its CRDs carry no Argo CD tracking id.

Evidence

Live, read-only, 2026-10-17 (labels only; no Secret data read):

  • kubectl get secret -A -l owner=helm: 15 status=deployed records. Eleven are argocd v122, open-webui v130, qdrant v125, loki v83, dcgm-exporter v82, grafana v50, k8s-monitoring v53, prometheus-operator-crds v28, prometheus v48, pyroscope v24 and otel-collector v127, created 2026-10-06 16:55:37Z to 16:56:09Z; one is traefik v2 in kube-system (2026-09-30); three are k8s-monitoring-alloy-*, owned by alloy-operator through ownerReferences. Each of the eleven keeps 10 records, so 112 stale Secrets in all.
  • deploy/argocd-server, deploy/prometheus-server and deploy/traefik carry both meta.helm.sh/release-name and argocd.argoproj.io/tracking-id; argocd-image-updater, installed only by Argo CD, has no Helm annotation.
  • Application prometheus-operator-crds is Synced and Healthy with an empty status.history and no operationState. CRD servicemonitors.monitoring.coreos.com has app.kubernetes.io/managed-by=Helm, meta.helm.sh/release-name=prometheus-operator-crds, helm.sh/resource-policy=keep, and no tracking id; its field managers include no argocd-controller.
  • AppProject homelab holds the sh.helm.release.v1.* ignore, and no Application shows OrphanedResourceWarning. AppProject homelab-system (traefik) has no orphanedResources setting.

Repo:

  • k8s/argocd/apps/projects.yaml:69-71 (the ignore, from v0.2.27 fe6047c, uncommented); tests/test_k8s_argocd_apps.py:206 pins it.
  • k8s/README.md "Bootstrap & Adoption" (:446) has no retirement step; Recovery (:459-472, :465) runs helm upgrade --install argocd, which writes a new argocd record each time.
  • Runbooks naming these releases: docs/agent/tasks/task-549-...md:80, task-550-...md:76,95, task-1080-...md:45; knowledge base src/devops_cli/ai/knowledge_base/it_domains/tools/helm.md:56,59 (helm rollback prometheus 1 -n monitoring, helm uninstall prometheus -n monitoring).
  • Related, not the same: fix(k8s): deploy-stack decides helm recovery from helm's json status and adopts existing resources with --take-ownership #1438 (deploy-stack's Helm recovery on the native path).

Remedy

  1. devops argo cd apps bootstrap-gitops offers the retirement behind --plan/--confirm (tests first, on the shared fake cluster): for each release an Application in homelab or homelab-system now renders, check that every live object of the release carries that Application's tracking id, then delete the release's records (owner=helm,name=<release>); skip any record whose ownerReferences point to an Alloy CR. --plan lists what it would delete and makes no write.
  2. Document the same step at the end of "Bootstrap & Adoption" and of Recovery (k8s/README.md:446, :459-472), since Recovery's helm upgrade --install argocd recreates a record.
  3. Remove the sh.helm.release.v1.* ignore at projects.yaml:69-71 and its pin at tests/test_k8s_argocd_apps.py:206; Argo CD's orphan check skips the Alloy records because they have ownerReferences.
  4. Mark the helm rollback/helm uninstall lines in task-549, task-550 and task-1080 as native-path only, and change helm.md:56,59 so the knowledge base does not tell anyone to run Helm against a release Argo CD manages.
  5. Pending a person: trigger one sync of Application prometheus-operator-crds so its 10 CRDs get the tracking id (server-side apply keeps helm.sh/resource-policy: keep), and run the retirement with --confirm.

Priority: P3. Severity low: nothing is broken, but a documented command would damage Argo CD-owned objects and the orphan ignore hides the leftovers.

Proposed design

Problem statement

The Argo CD adoption process left behind Helm release records for eleven charts that are now managed by Argo CD, creating confusion and potential data loss risks when users attempt to run Helm commands against these releases. These stale records carry both Helm's release annotations and Argo CD's tracking IDs, and the orphan ignore in AppProject prevents proper reporting of leftover Secrets.

Acceptance criteria

  • Criterion 1: The bootstrap-gitops command removes stale Helm release records for charts now managed by Argo CD
    Verification: Run 'devops argo cd apps bootstrap-gitops --plan' and verify it lists the 11 releases to be deleted, then run with '--confirm' to actually delete them
  • Criterion 2: The AppProject orphan ignore is removed for the affected namespaces
    Verification: Check that 'k8s/argocd/apps/projects.yaml' no longer contains the sh.helm.release.v1.* ignore rule, and verify tests no longer pin it
  • Criterion 3: Runbooks are updated to reflect that Helm commands should not be run against Argo CD-managed releases
    Verification: Verify that documentation files like task-549.md, task-550.md and helm.md no longer mention running 'helm rollback' or 'helm uninstall' on the affected releases
  • Criterion 4: The Application 'prometheus-operator-crds' syncs properly to get Argo CD tracking IDs for its CRDs
    Verification: Run a sync of Application 'prometheus-operator-crds' and verify that CRDs now carry Argo CD tracking IDs instead of only Helm annotations

Key questions

  • What are the exact 11 charts whose Helm release records need to be retired?: The 11 charts are: argocd v122, open-webui v130, qdrant v125, loki v83, dcgm-exporter v82, grafana v50, k8s-monitoring v53, prometheus-operator-crds v28, prometheus v48, pyroscope v24 and otel-collector v127 [sources: k8s/README.md:446]
  • What namespaces contain the Helm release records that need to be retired?: The releases are in the 'homelab' and 'homelab-system' AppProjects, with one release (traefik) in the kube-system namespace [sources: k8s/README.md:446]
  • Should the retirement process delete Helm release records for all charts or skip some?: The retirement should skip any record whose ownerReferences point to an Alloy CR, as these are managed by alloy-operator (proposed) [sources: k8s/README.md:446]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/chore
    on Oct 18, 2026
  2. dan-petty commented on Oct 18, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Type: type/chore. The candidate describes a maintenance task related to k8s and Argo CD operations, not a new feature or bug fix.
    • Priority: P2-Medium. This is a medium-priority operational issue affecting resource management and deployment consistency.
    • Value: Medium. The change improves cluster stability and prevents potential conflicts but doesn't directly impact user-facing functionality or security.
    • Effort: High. The solution involves multiple steps including code changes, documentation updates, and testing across various components.
  3. dan-petty commented on Oct 22, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at ae8c2d9 (see proposed design in issue body).

  4. added
    priority/p2-medium
    status/ready
    value/medium
    effort/high
    on Oct 28, 2026
  5. added a commit that references this issue on Oct 29, 2026
    cabfcd4
  6. removed
    status/ready
    on Oct 30, 2026
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

    effort/highpriority/p2-mediumsource/agenttype/chorevalue/medium

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions