apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
  name: "mutating-admission.qaware.de"
webhooks:
- name: "mutating-admission.qaware.de"
  # this here is important, 
  # otherwise the admission webhook pods are not scheduled!
  objectSelector:
    matchLabels:    
      type: "microservice"
  rules:
  - apiGroups:   [""]
    apiVersions: ["v1"]
    operations:  ["CREATE", "UPDATE"]
    resources:   ["pods"]
    scope:       "Namespaced"
  clientConfig:
    service:
      namespace: "default"
      name: "mutating-admission-service"  
      path: /mutate
  admissionReviewVersions: ["v1", "v1beta1"]
  sideEffects: None
  timeoutSeconds: 10