argo-cd: ignoreDifferences in namespaceSelector in Webhook
Hello,
I am trying to use argoCD
to deploy seldon-core-operator
seldon-core-operator
installs a mutatingwebhookconfiguration
and a validatingwebhookconfiguration
After installation, the live manifest has an additional namespace selector as shown below
The path to the namespaceSelector
as validated in the live mutatingwebhookconfiguration
using yq
is
$ cat liveMutatingWebhookConfiguration.yaml | yq r - "webhooks[0].namespaceSelector.matchExpressions[1]"
key: control-plane
operator: DoesNotExist
So I tried adding the following ignoreDifferences
spec
- group: admissionregistration.k8s.io
kind: MutatingWebhookConfiguration
name: seldon-mutating-webhook-configuration-{{ .Values.global.spec.destination.namespace }}
namespace: {{ .Values.global.spec.destination.namespace }}
jsonPointers:
- /webhooks/0/clientConfig/caBundle
- /webhooks/0/namespaceSelector/matchExpressions/1
However, this does not seem to resolve the difference and argoCD
still reports the namespaceSelector
as different and shows the webhookconfigurations
as OutOfSync
How can I fix this?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 11
- Comments: 21 (2 by maintainers)
I had the same problem with
cert-manager
onAKS
, and tweaked @fdebuire 's suggestion to usejqPathExpressions
, which also worked:I used:
If you find your way here while trying to use ArgoCD to configure Istio, and are getting an
OutOfSync
error onistiod-default-validator
, the following configuration in an ArgoCD app that installs theistio/base
Helm chart will help:I’m on
Argo v2.1.1
deployed withkubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/v2.1.1/manifests/install.yaml
, and the following manifest works for me using theargoproj.io/v1alpha1
apiVersion.Seems like could be solved with one-liner here:
I trying to apply the above example on argocd-2.1.2 and I am getting the following error.
Kubernetes-1.20.0
Got into the same issue with
cert-manager
on AKS (https://github.com/Azure/AKS/issues/1771) and this is what worked for me:However when I tried to narrow to the specific resource by adding the optional namespace filter it doesn’t work anymore.
I ran into this issue again playing with Argo v2.9 (v2.9.0-rc2) that started failing on this solution due to an "invalid patch."I couldn’t find a format that would make ArgoCD happy, but ultimately moving it to the declarative config map (https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/) did the trick. For reference:
Inspiration: https://argo-cd.readthedocs.io/en/stable/user-guide/diffing/#system-level-configuration
In my case I have an app of apps deployment in ArgoCD.
The System Level Diffing configuration that is documented in the ArgoCD docs worked fine for the parent application that is not out-of-sync anymore. But unfortunately this is not the case for the application that the MutatingWebhookConfiguration belongs to.
Does this mean that I have to put this ignoreDifferences on every application that has the Mutating/ValidatingWebhookConfiguration ?