apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
  name: "deployment.webhook.com"
webhooks:
- name: "deployment.webhook.com"
  namespaceSelector:
    matchExpressions:
    - key: runlevel
      operator: NotIn
      values:
      - "0"
      - "1"
  rules:
  - apiGroups:   ["apps"]
    apiVersions: ["v1"]
    operations:  ["CREATE"]
    resources:   ["deployments"]
    scope:       "Namespaced"
  clientConfig:
    service:
      namespace: "default"
      name: "deploy-mutate-webhook"  
      path: /mutate
  admissionReviewVersions: ["v1", "v1beta1"]
  sideEffects: None
  timeoutSeconds: 10
