Skip to content

2026-11-06: webshop CNPG operator gate failed, the demo shop's database was not in CLUSTERS

Kind: reference (incident report)

Severity: warning · Status: open (fix in review) · Resolved by: operator agent, once the fix merges · Duration: not resolved in the run (Job failed 05:35:07, alert from 05:50:55) · Taskbase task: #2625

Summary

The alpine/k8s 1.37.2 bump (#1176) changed the pod template of the webshop cluster's CNPG operator gate Job, so Flux recreated it. The gate refused to pass because shop-demo/shop-demo-db archives to the backup store but had never been added to the gate's CLUSTERS, nor given a weekly restore drill. The failed Job holds cloudnative-pg and its dependents, shop-demo included, until the fix (the drill and the gate line) merges.

Impact

  • Services: Flux Kustomization cloudnative-pg-preupgrade failed its health check, so cloudnative-pg stayed on revision deb6fb85. shop-demo, which depends on it, cannot apply a new deploy/demo of eloro/webshop-platform until the gate passes. The running CNPG operator (chart 0.29.1, Helm revision 1 deployed) and shop-demo-db were not touched and stayed healthy.
  • Users: none noticed; the demo shop kept running on its last applied revision.
  • Data: none lost. shop-demo-db has had daily backups (the newest completed at 02:00), but no restore drill had ever checked one.
  • Duration: from the Job's failure at 05:35:07 until the fix's pull request merges.

Timeline

All times UTC.

Time Event Source
05:31:25 #1176 (alpine/k8s 1.37.2) merged; it changes the image of the gate Job git log a0673af9
05:34:54 Flux recreates cnpg-drill/cnpg-operator-preupgrade (kustomize.toolkit.fluxcd.io/force) Job creationTimestamp
05:35:07 The Job fails: shop-demo/shop-demo-db archives to the backup store but is not in CLUSTERS: add it with its drill query Job conditions, pod log
05:50:55 Detected: KubeJobFailed fires for cnpg-drill/cnpg-operator-preupgrade Alertmanager
05:51:56 Taskbase opens incident #2625 task
05:54 operator confirms the alert fires, unsilenced, and reads the Job's log Alertmanager /api/v2/alerts
06:00 Fix opened: drill drill-demo and the gate line for shop-demo-db #1258

Root cause

The demo shop's chart in eloro/webshop-platform owns shop-demo-db and gave it the Barman Cloud plugin, an ObjectStore and a daily ScheduledBackup when the demo shop was registered (#2170). The two steps on this repository's side, listed in the webshop README and in Adding backups to a Cluster (steps 5 and 6), were not done: no drill-demo CronJob, and CLUSTERS in cluster/webshop/cloudnative-pg/preupgrade/job.yaml stayed "".

preupgrade.sh fails for any Cluster outside cnpg-drill that archives to the store and is not listed, before it backs anything up. The gate only runs when its Job is recreated, so the gap stayed hidden until something changed the Job's pod template. The README said that the next operator chart upgrade would fail, but any change does: here an image bump of the gate's tool. With backoffLimit: 0, a failed Job stays failed until its spec changes or it is deleted.

What the agent did

Followed the ops runbook's KubeJobFailed section: the Job's label names Flux Kustomization cloudnative-pg-preupgrade, so the fix is in Git and the force annotation recreates the Job.

  1. kubectl -n monitoring port-forward svc/alertmanager-operated 9093 and curl -sG localhost:9093/api/v2/alerts --data-urlencode 'filter=alertname="KubeJobFailed"' — one alert, cnpg-drill/cnpg-operator-preupgrade, state: active, no silence.
  2. kubectl -n cnpg-drill get job cnpg-operator-preupgrade -o yaml and kubectl logs of its pod — BackoffLimitExceeded, CLUSTERS empty, the error above.
  3. flux get kustomizations -A — many Kustomizations "dependency ... is not ready" while main moved three times (5471fe36, 6bc05b68, 594e4763). This was the ordinary dependency wave: every reconcile that ran succeeded. The one root that was not Ready for its own reason was cloudnative-pg-preupgrade.
  4. kubectl -n shop-demo get cluster shop-demo-db — plugin barman-cloud.cloudnative-pg.io, serverName: demo, database shop; get backups — daily backups completed, the newest at 02:00.
  5. kubectl -n shop-demo exec shop-demo-db-1 -c postgres -- psql -d shop -tAc "SELECT ..." (read-only) — river_migration has 8 rows, filled by the shop's migrate Job on every deploy, so the drill query is SELECT count(*) FROM river_migration.
  6. Pull request #1258 — adds cluster/webshop/cloudnative-pg/drill/cron-job.yaml with drill-demo (Sundays 04:00), adds the line shop-demo shop-demo-db SELECT count(*) FROM river_migration to CLUSTERS, a test that every webshop drill is in CLUSTERS with the same query, and corrects the README. kubectl apply --dry-run=server of the CronJob passed against the live cluster.

No write was made to the cluster. Deleting the failed Job before the fix would only have recreated the same failing Job.

Resolution and verification

Not resolved in the run. After the merge, Flux recreates the gate Job with the new CLUSTERS. It takes an on-demand Backup of shop-demo-db, restores it into preupgrade-demo in cnpg-drill and checks the query. Then cloudnative-pg and shop-demo become Ready. To verify:

kubectl --context webshop -n cnpg-drill wait --for=condition=complete job/cnpg-operator-preupgrade --timeout=40m
kubectl --context webshop -n cnpg-drill get configmap preupgrade-demo -o jsonpath='{.data}'
flux --context webshop get kustomizations cloudnative-pg-preupgrade cloudnative-pg shop-demo

KubeJobFailed resolves once the failed Job is replaced.

Follow-ups

  • The first drill-demo run, Sunday 2026-11-08 04:00, or a manual run (kubectl -n cnpg-drill create job --from=cronjob/drill-demo drill-demo-manual), shows the drill passing on its own.

References

Open questions

none