GitOps-safe: generateSecrets, and Argo CD hook order (K-C14) #40

Merged
jcoffey-dev merged 1 commits from feat/gitops-safe into main 2026-11-20 08:16:38 +00:00
Owner

The chart half of K-C14 (#38). The issue stays open until K-L10 runs it under Argo CD and Flux with selfHeal on.

Generated secrets. Argo CD and helm template | kubectl apply render without the cluster, so lookup returns nothing. The webmail's Secret and the metrics password were therefore made new on every sync: the app never shows Synced, and every webmail user is signed out. generateSecrets: false (default true, so Helm users see no change) makes the chart refuse to render until webmail.existingSecret and server.metrics.prometheus.existingSecret are named. The error says what each Secret needs.

Hook order under Argo CD. Argo runs Helm's pre-install and pre-upgrade hooks as PreSync on every sync, and drops pre-rollback. Before, the seed and upgrade Jobs both had weight 0 and ran together. Every hook now carries Argo's own hook, sync-wave and hook-delete-policy annotations beside Helm's:

Wave What
-30 hook NetworkPolicies (deny-all, jobs)
-25 to -20 upgrade: rights, script, Job
-15, -10 seed: ConfigMap, Job
PostSync egress check

The upgrade goes first on purpose. --seed upgrades the store's layout before seeding, so a seed ahead of it would skip acknowledgeLayout and the stop-servers step. I checked the server code: on a new store --upgrade-plan returns NewStore and exits 0 (so upgrade.sh does nothing), and it doesn't insert the defaults, so the seed after it still sees a new store. On later syncs the seed finds a seeded store and does nothing. Helm's own weights are unchanged.

Release manifests. The rendered example on the release page (ci/defaults-values.yaml) contains no Secret, so nothing generated is published.

Checks: new unit tests for both refusals, the upgrade-before-seed waves and the hook NetworkPolicy annotations. tools/check.sh passes (lint under Helm 4 and 3, kubeconform 1.35–1.37, kube-linter, 113 unit tests). VALUES.md regenerated, CHANGELOG line added.

The chart half of K-C14 (#38). The issue stays open until K-L10 runs it under Argo CD and Flux with selfHeal on. **Generated secrets.** Argo CD and `helm template | kubectl apply` render without the cluster, so `lookup` returns nothing. The webmail's Secret and the metrics password were therefore made new on every sync: the app never shows Synced, and every webmail user is signed out. `generateSecrets: false` (default `true`, so Helm users see no change) makes the chart refuse to render until `webmail.existingSecret` and `server.metrics.prometheus.existingSecret` are named. The error says what each Secret needs. **Hook order under Argo CD.** Argo runs Helm's `pre-install` and `pre-upgrade` hooks as PreSync on *every* sync, and drops `pre-rollback`. Before, the seed and upgrade Jobs both had weight 0 and ran together. Every hook now carries Argo's own `hook`, `sync-wave` and `hook-delete-policy` annotations beside Helm's: | Wave | What | |---|---| | -30 | hook NetworkPolicies (deny-all, jobs) | | -25 to -20 | upgrade: rights, script, Job | | -15, -10 | seed: ConfigMap, Job | | PostSync | egress check | The upgrade goes first on purpose. `--seed` upgrades the store's layout before seeding, so a seed ahead of it would skip `acknowledgeLayout` and the stop-servers step. I checked the server code: on a new store `--upgrade-plan` returns NewStore and exits 0 (so `upgrade.sh` does nothing), and it doesn't insert the defaults, so the seed after it still sees a new store. On later syncs the seed finds a seeded store and does nothing. Helm's own weights are unchanged. **Release manifests.** The rendered example on the release page (`ci/defaults-values.yaml`) contains no Secret, so nothing generated is published. **Checks:** new unit tests for both refusals, the upgrade-before-seed waves and the hook NetworkPolicy annotations. `tools/check.sh` passes (lint under Helm 4 and 3, kubeconform 1.35–1.37, kube-linter, 113 unit tests). VALUES.md regenerated, CHANGELOG line added.
jcoffey-dev added 1 commit 2026-11-20 08:15:27 +00:00
GitOps-safe: generateSecrets, and Argo CD hook order (K-C14)
ci / chart (pull_request) Successful in 39s
lab / e2e the lab on GitHub passed
7586a3faee
Argo CD and helm template | kubectl apply render without the cluster, so
lookup returns nothing and the webmail's and metrics Secrets were made new
on every sync: never Synced, and every webmail user signed out.
generateSecrets: false (default true) makes the chart refuse to render
until webmail.existingSecret and server.metrics.prometheus.existingSecret
are named.

Argo runs pre-install and pre-upgrade hooks as PreSync on every sync, so
the seed ran every time and, on a first sync, at the same weight as the
upgrade Job. Every hook now carries Argo's own hook, sync-wave and delete
policy annotations beside Helm's: hook NetworkPolicies (-30), the upgrade
(-25 to -20), then the seed (-15, -10). Upgrade first matters: --seed
upgrades the store's layout before it seeds, which would skip the
acknowledgement and the stop. On a new store --upgrade-plan exits 0 and
writes no defaults, so the seed after it still sees a new store. The
egress check is PostSync. Helm's own weights are unchanged.

The release's rendered manifests (defaults) contain no Secret, so nothing
generated is published. Unit tests for both refusals and the Argo order;
VALUES.md regenerated; tools/check.sh passes.
jcoffey-dev merged commit 6bbeccaac4 into main 2026-11-20 08:16:37 +00:00
jcoffey-dev deleted branch feat/gitops-safe 2026-11-20 08:16:38 +00:00
Sign in to join this conversation.