<p>I have a working mutating admission hook for kubernetes. It is called when I first deploy and app using helm. But it is not called when I update using helm. It will in fact call it if I change the version number for the deployment. But if only the content changed, then it skips calling the hook. </p>

<p>How can I make it always call the hook for any deployment?</p>

<p>Here is my hook config:</p>

<pre><code>    apiVersion: admissionregistration.k8s.io/v1beta1
    kind: MutatingWebhookConfiguration
    metadata:
    name: appcfg-mutator
    webhooks:
    - name: appcfg-mutator.devops.primerica.com
        clientConfig:
        service:
            name: appcfg-mutator
            namespace: appcfg-mutator
            path: "/"
        caBundle: {{ .Values.webhook.caBundle }}
        rules:
        - operations: ["*"]
            apiGroups: [""]
            apiVersions: ["v1","v1beta1","v1beta2"]
            resources: ["pod","deployments","namespaces","services"]
        failurePolicy: Fail
</code></pre>

<p>I log all requests as soon as they arrive and before deserializing the http rq body so I can see it's not getting called each update. Only on create, delete or when version field in yaml is changed.</p>

Jerico Sandhorn
<p>Turns out I had a typo in my mutator config for "pod" instead of "pods". Plus, I was misunderstanding and expecting to see "deployments" updates since I was actually changing the "Deployment" kind yaml. Its just "pods" that I needed. </p>

<p>Here is the correction:</p>

<pre><code>resources: ["pods","deployments","namespaces","services"]
</code></pre>
