Skip to content

fix: ignore CRD label differences for Kyverno#86

Merged
butler54 merged 1 commit into
validatedpatterns:mainfrom
butler54:fix/kyverno-crd-sync
May 27, 2026
Merged

fix: ignore CRD label differences for Kyverno#86
butler54 merged 1 commit into
validatedpatterns:mainfrom
butler54:fix/kyverno-crd-sync

Conversation

@butler54
Copy link
Copy Markdown
Collaborator

Summary

Fixes ArgoCD sync issues on fresh deployments where Kyverno's migration job creates the policies.kyverno.io CRD without Helm labels.

Changes

  • Add ignoreDifferences configuration to kyverno application in all profiles (simple, baremetal, baremetal-gpu)
  • Add RespectIgnoreDifferences=true syncOption to ensure other drift is still detected
  • Configure ArgoCD to ignore label and annotation differences on policies.kyverno.io CRD

Root Cause

Kyverno's Helm chart includes a migration job that creates the policies.kyverno.io CRD before the chart's CRD templates are applied. This migration job doesn't add Helm labels to the CRD, but the chart expects to manage it with labels. This causes ArgoCD to report the application as OutOfSync.

Solution

Rather than patching the CRD manually on each deployment, configure ArgoCD to ignore the label/annotation differences on this specific CRD while still respecting all other configuration drift.

Testing

Deploy on a fresh cluster and verify:

  • Kyverno application reaches Synced status without manual intervention
  • CRD label differences do not cause OutOfSync state
  • Other configuration drift is still detected (RespectIgnoreDifferences ensures this)

Part of Wave 1 attestation hardening work.

@butler54 butler54 requested a review from a team May 27, 2026 01:52
Kyverno's migration job creates policies.kyverno.io CRD without Helm
labels, causing ArgoCD sync issues. Configure ignoreDifferences to
ignore label/annotation mismatches on the CRD while respecting all
other drift via RespectIgnoreDifferences syncOption.

Fixes fresh deployment sync issues where migration job runs before
Helm chart manages the CRD.
@butler54 butler54 force-pushed the fix/kyverno-crd-sync branch from fc60f2b to d28167d Compare May 27, 2026 02:40
@butler54 butler54 merged commit 4419a55 into validatedpatterns:main May 27, 2026
5 checks passed
@butler54 butler54 deleted the fix/kyverno-crd-sync branch May 27, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant