Argo-cd: Ability to selectively ignore differences to support fuzzy diff comparisons

Created on 31 Jan 2019  路  2Comments  路  Source: argoproj/argo-cd

Thank you very much for your work on Argo CD, this project is an excellent implementation of CD in Kubernetes.

As per the FAQs, mutating webhooks will cause the deployment to be shown as OutOfSync - what is the best method for dealing with this?

I'm thinking of a directive that tells argocd what part of the MutatingWebhookConfiguration to monitor - is there a better way at present?

Most helpful comment

How should this work when I have multiple webhooks defined in one resource?? It currently seems like I have to do

  resource.customizations: |
    admissionregistration.k8s.io/MutatingWebhookConfiguration:
      ignoreDifferences: |
        jsonPointers:
        - /webhooks/0/clientConfig/caBundle
        - /webhooks/1/clientConfig/caBundle
        - /webhooks/2/clientConfig/caBundle
        - /webhooks/3/clientConfig/caBundle
        - /webhooks/4/clientConfig/caBundle
        - /webhooks/5/clientConfig/caBundle

I don't know exactly how many webhooks may be specified and I'm trying to solve this all at once. I'd really like to just be able to wildcard the number?

All 2 comments

I'm thinking of a directive that tells argocd what part of the MutatingWebhookConfiguration to monitor - is there a better way at present?

So, MutatingWebhookConfiguration is just one of several causes of OutOfSync. There are at least two others I can think of:

This appears to be a common enough problem that we should consider some facility in Argo CD to allowing users to ignore differences of objects at a specific json path. For example, this might be how one could ignore just the spec.replicas of all Deployments in the app.

spec:
  ignoreDifferences:
  - kind: Deployment
    json6902Paths:
    - spec/replicas

And here might how to describe to ignore ALL differences for a single object in the app.

spec:
  ignoreDifferences:
  - name: guestbook           # optional
    kind: Deployment
    namespace: my-namespace   # optional
    json6902Paths:
    - '*'

We could even extend this to apply this at a system level, using resource customizations. So in the argocd-cm configmap, this could ignore differences for all Deployment's spec.replicas:

data:
  resource.customizations: |
    apps/Deployment:
      ignoreDifferences:
        json6902Paths:
        - spec/replicas

And this would be an example to ignore caBundle of MutatingWebhookConfiguration webhooks:

data:
  resource.customizations: |
    admissionregistration.k8s.io/MutatingWebhookConfiguration:
      ignoreDifferences:
        json6902Paths:
        - webhooks/0/clientConfig/caBundle

How should this work when I have multiple webhooks defined in one resource?? It currently seems like I have to do

  resource.customizations: |
    admissionregistration.k8s.io/MutatingWebhookConfiguration:
      ignoreDifferences: |
        jsonPointers:
        - /webhooks/0/clientConfig/caBundle
        - /webhooks/1/clientConfig/caBundle
        - /webhooks/2/clientConfig/caBundle
        - /webhooks/3/clientConfig/caBundle
        - /webhooks/4/clientConfig/caBundle
        - /webhooks/5/clientConfig/caBundle

I don't know exactly how many webhooks may be specified and I'm trying to solve this all at once. I'd really like to just be able to wildcard the number?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

niqdev picture niqdev  路  23Comments

raffaelespazzoli picture raffaelespazzoli  路  21Comments

phillebaba picture phillebaba  路  23Comments

jessesuen picture jessesuen  路  24Comments

cchanley2003 picture cchanley2003  路  25Comments