apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
  name: admission-controller-demo
webhooks:
  - name: admission-controller-demo-1
    # Optionally restrict events from namespaces with a specific label.
    # namespaceSelector:
    #   matchLabels:
    #     some-label: "true"
    clientConfig:
      url: "{URL}/mutate"
      # For controllers behind k8s services, use the format below instead of a
      # url:
      # service:
      #   name: admission-controller
      #   namespace: colin-coder
      #   path: "/mutate"
      # caBundle: "{CA_PEM}"
    rules:
      - operations: ["CREATE"]
        apiGroups: [""]
        apiVersions: ["clux.dev/v1"]
        resources: ["foos"]
    failurePolicy: Fail
    admissionReviewVersions: ["v1", "v1beta1"]
    sideEffects: NoneOnDryRun
    timeoutSeconds: 5
