fix: ignore CRD label differences for Kyverno#86
Merged
Conversation
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.
fc60f2b to
d28167d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes ArgoCD sync issues on fresh deployments where Kyverno's migration job creates the
policies.kyverno.ioCRD without Helm labels.Changes
ignoreDifferencesconfiguration to kyverno application in all profiles (simple, baremetal, baremetal-gpu)RespectIgnoreDifferences=truesyncOption to ensure other drift is still detectedpolicies.kyverno.ioCRDRoot Cause
Kyverno's Helm chart includes a migration job that creates the
policies.kyverno.ioCRD 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:
Part of Wave 1 attestation hardening work.