feat: manage Longhorn with an ArgoCD Application #87

Merged
ivuorinen merged 1 commit from ivuorinen/feat/longhorn-argocd into main 2026-10-07 06:35:29 +00:00 AGit
Owner

Longhorn was the last component changed by running a script from a
workstation (scripts/07-install-longhorn.sh, helm upgrade --install). It is
now an ArgoCD Application, and the script is deleted.

Merge after "feat(argocd): let Kustomize inflate Helm charts", once
argocd-config is Synced: this Application is rendered with
kustomize.buildOptions --enable-helm, which that PR adds to argocd-cm.

What it does

  • gitops/apps/longhorn/kustomization.yaml inflates the Longhorn 1.12.1 chart
    through helmCharts, with the five values the live release has
    (helm get values) plus preUpgradeChecker.jobEnabled: false from Longhorn's
    ArgoCD install guide. Kustomize rather than a chart-sourced Application so
    its patches can put kube-linter ignore annotations on the longhorn-manager
    DaemonSet and the post-upgrade Job — the chart's values reach neither — and
    remove the chart's uninstall Job.
  • The uninstall Job is removed on purpose. ArgoCD v3.5.3 runs a helm
    pre-delete hook as PreDelete and re-creates it every reconcile while it
    fails; with deleting-confirmation-flag false the Application could never
    be deleted, and with it true deleting the Application would uninstall
    Longhorn. Without it, deleting the Application only stops tracking.
  • gitops/argocd-apps/longhorn.yaml: path-sourced, sync-wave -4, autosync +
    prune, no finalizer.

Adoption is in place. The render, diffed client-side against the live
cluster with hook objects excluded, differs only in the two annotations on
longhorn-manager's own metadata — not its pod template, so nothing restarts.
The same holds when rendered the way ArgoCD v3.5.3 does (Helm 4.2.1,
Kustomize 5.8.1, the cluster's version and API list).

Checks

  • scripts/ci/render-applications.sh renders Kustomize-inflated charts too,
    from a copy (kustomize writes charts/ beside kustomization.yaml), and fails
    on a kustomization.yaml it cannot parse instead of skipping it.
    tests/render-applications.bats pins that; the helm-render hook pattern now
    reaches the Kustomization (tests/hook-coverage.bats).
  • tests/version-sync.bats: app_chart_version returned 1 for a HEAD-tracking
    Application, contradicting its own comment.

Renovate

  • The chart pin lives in the Kustomization; Renovate's kustomize manager
    reads it. Longhorn is never automerged and every major and minor stream is
    its own PR, because Longhorn supports one minor step at a time.
  • A postUpgradeTask regenerates schemas/ in the bump PR.
    scripts/generate-crd-schemas.py now reads YAML with PyYAML as a PEP 723 uv
    script, since Renovate can install helm, python and uv but not yq; the
    Renovate global config allows that one anchored command.

Docs

docs/01, 02, 04, 05 and 11, README and the manifest comments follow. Rebuilding
with a restore now hands the restore's dependencies to ArgoCD before
bootstrapping (docs/04-storage.md), because Longhorn arrives in the same root
sync as the apps whose volumes it restores. The Longhorn chart's inherited
security posture is recorded there as an explicit acceptance.

The spec and plan are under docs/superpowers/. docs/audit/findings records the
changed-files audit run on this branch; all six findings are resolved here.

Longhorn was the last component changed by running a script from a workstation (scripts/07-install-longhorn.sh, helm upgrade --install). It is now an ArgoCD Application, and the script is deleted. Merge after "feat(argocd): let Kustomize inflate Helm charts", once argocd-config is Synced: this Application is rendered with kustomize.buildOptions --enable-helm, which that PR adds to argocd-cm. What it does - gitops/apps/longhorn/kustomization.yaml inflates the Longhorn 1.12.1 chart through helmCharts, with the five values the live release has (helm get values) plus preUpgradeChecker.jobEnabled: false from Longhorn's ArgoCD install guide. Kustomize rather than a chart-sourced Application so its patches can put kube-linter ignore annotations on the longhorn-manager DaemonSet and the post-upgrade Job — the chart's values reach neither — and remove the chart's uninstall Job. - The uninstall Job is removed on purpose. ArgoCD v3.5.3 runs a helm pre-delete hook as PreDelete and re-creates it every reconcile while it fails; with deleting-confirmation-flag false the Application could never be deleted, and with it true deleting the Application would uninstall Longhorn. Without it, deleting the Application only stops tracking. - gitops/argocd-apps/longhorn.yaml: path-sourced, sync-wave -4, autosync + prune, no finalizer. Adoption is in place. The render, diffed client-side against the live cluster with hook objects excluded, differs only in the two annotations on longhorn-manager's own metadata — not its pod template, so nothing restarts. The same holds when rendered the way ArgoCD v3.5.3 does (Helm 4.2.1, Kustomize 5.8.1, the cluster's version and API list). Checks - scripts/ci/render-applications.sh renders Kustomize-inflated charts too, from a copy (kustomize writes charts/ beside kustomization.yaml), and fails on a kustomization.yaml it cannot parse instead of skipping it. tests/render-applications.bats pins that; the helm-render hook pattern now reaches the Kustomization (tests/hook-coverage.bats). - tests/version-sync.bats: app_chart_version returned 1 for a HEAD-tracking Application, contradicting its own comment. Renovate - The chart pin lives in the Kustomization; Renovate's kustomize manager reads it. Longhorn is never automerged and every major and minor stream is its own PR, because Longhorn supports one minor step at a time. - A postUpgradeTask regenerates schemas/ in the bump PR. scripts/generate-crd-schemas.py now reads YAML with PyYAML as a PEP 723 uv script, since Renovate can install helm, python and uv but not yq; the Renovate global config allows that one anchored command. Docs docs/01, 02, 04, 05 and 11, README and the manifest comments follow. Rebuilding with a restore now hands the restore's dependencies to ArgoCD before bootstrapping (docs/04-storage.md), because Longhorn arrives in the same root sync as the apps whose volumes it restores. The Longhorn chart's inherited security posture is recorded there as an explicit acceptance. The spec and plan are under docs/superpowers/. docs/audit/findings records the changed-files audit run on this branch; all six findings are resolved here.
feat: manage Longhorn with an ArgoCD Application
All checks were successful
validate / render (pull_request) Successful in 56s
validate / hooks (pull_request) Successful in 3m44s
856c1965aa
Longhorn was the last component changed by running a script from a
workstation (scripts/07-install-longhorn.sh, helm upgrade --install). It is
now an ArgoCD Application, and the script is deleted.

Merge after "feat(argocd): let Kustomize inflate Helm charts", once
argocd-config is Synced: this Application is rendered with
kustomize.buildOptions --enable-helm, which that PR adds to argocd-cm.

What it does

- gitops/apps/longhorn/kustomization.yaml inflates the Longhorn 1.12.1 chart
  through helmCharts, with the five values the live release has
  (helm get values) plus preUpgradeChecker.jobEnabled: false from Longhorn's
  ArgoCD install guide. Kustomize rather than a chart-sourced Application so
  its patches can put kube-linter ignore annotations on the longhorn-manager
  DaemonSet and the post-upgrade Job — the chart's values reach neither — and
  remove the chart's uninstall Job.
- The uninstall Job is removed on purpose. ArgoCD v3.5.3 runs a helm
  pre-delete hook as PreDelete and re-creates it every reconcile while it
  fails; with deleting-confirmation-flag false the Application could never
  be deleted, and with it true deleting the Application would uninstall
  Longhorn. Without it, deleting the Application only stops tracking.
- gitops/argocd-apps/longhorn.yaml: path-sourced, sync-wave -4, autosync +
  prune, no finalizer.

Adoption is in place. The render, diffed client-side against the live
cluster with hook objects excluded, differs only in the two annotations on
longhorn-manager's own metadata — not its pod template, so nothing restarts.
The same holds when rendered the way ArgoCD v3.5.3 does (Helm 4.2.1,
Kustomize 5.8.1, the cluster's version and API list).

Checks

- scripts/ci/render-applications.sh renders Kustomize-inflated charts too,
  from a copy (kustomize writes charts/ beside kustomization.yaml), and fails
  on a kustomization.yaml it cannot parse instead of skipping it.
  tests/render-applications.bats pins that; the helm-render hook pattern now
  reaches the Kustomization (tests/hook-coverage.bats).
- tests/version-sync.bats: app_chart_version returned 1 for a HEAD-tracking
  Application, contradicting its own comment.

Renovate

- The chart pin lives in the Kustomization; Renovate's kustomize manager
  reads it. Longhorn is never automerged and every major and minor stream is
  its own PR, because Longhorn supports one minor step at a time.
- A postUpgradeTask regenerates schemas/ in the bump PR.
  scripts/generate-crd-schemas.py now reads YAML with PyYAML as a PEP 723 uv
  script, since Renovate can install helm, python and uv but not yq; the
  Renovate global config allows that one anchored command.

Docs

docs/01, 02, 04, 05 and 11, README and the manifest comments follow. Rebuilding
with a restore now hands the restore's dependencies to ArgoCD before
bootstrapping (docs/04-storage.md), because Longhorn arrives in the same root
sync as the apps whose volumes it restores. The Longhorn chart's inherited
security posture is recorded there as an explicit acceptance.

The spec and plan are under docs/superpowers/. docs/audit/findings records the
changed-files audit run on this branch; all six findings are resolved here.
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!87
No description provided.