Ignore defaulted StatefulSet volumeClaimTemplates TypeMeta #350
Reference in New Issue
Block a user
Delete Branch "benvin/sts-vct-typemeta-ignorediff"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Kubernetes defaults
apiVersion: v1andkind: PersistentVolumeClaimonto every StatefulSetvolumeClaimTemplatesentry, but neither the raw manifests nor the rendered helm charts in this repo emit those fields. Live StatefulSets therefore carry TypeMeta that git lacks, and ArgoCD reports a diff that removes it.volumeClaimTemplatesare immutable on an existing StatefulSet, so ArgoCD can never apply the removal. The affected StatefulSets stay perpetually OutOfSync and the un-appliable diff can contribute to sync failures.Rendering the overlays confirms this is a chronic render-vs-live mismatch, not a regression: the source manifests/charts have never emitted the TypeMeta. Affected StatefulSets (render lacks TypeMeta, live defaults it in):
consul-server(consul, helm render)nats(logging, helm render)kanidm(kanidm, raw manifest)vaultand thewoodpeckerStatefulSets already emit TypeMeta from their charts and are unaffected.How
resource.customizations.ignoreDifferences.apps_StatefulSetto theargocd-cmpatch, usingjqPathExpressionsto ignore the defaultedapiVersionandkindunder everyvolumeClaimTemplatesentry.A single global customization is chosen over per-manifest edits because the affected StatefulSets span both raw manifests (kanidm) and helm renders (consul, nats) whose output cannot be edited; it is inert for StatefulSets that already emit TypeMeta (vault, woodpecker) and future-proof for new ones. The live StatefulSets are left untouched — their
volumeClaimTemplatesare immutable, and recreation would orphan PVCs.