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?
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:
HPA, as mentioned here: https://github.com/argoproj/argo-cd/issues/1072#issuecomment-459346827. The advice we give about HPA is to omit replicas in git. However, oftentimes replicas is explicitly set in upstream helm charts and is not convenient to change upstream.
Helm charts which use things like randAlphaNum template functions.
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?
Most helpful comment
How should this work when I have multiple webhooks defined in one resource?? It currently seems like I have to do
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?