apiVersion: admissionregistration.k8s.io/v1beta1
kind: MutatingWebhookConfiguration
metadata:
  name: clusterresourceoverrides.admission.autoscaling.openshift.io
  labels:
    clusterresourceoverride: "true"
webhooks:
  - name: clusterresourceoverrides.admission.autoscaling.openshift.io
    namespaceSelector:
      matchLabels:
        clusterresourceoverrides.admission.autoscaling.openshift.io/enabled: "true"
      matchExpressions:
        - key: runlevel
          operator: NotIn
          values: ["0","1"]
    matchPolicy: Equivalent
    clientConfig:
      url: https://localhost:9400/apis/admission.autoscaling.openshift.io/v1/clusterresourceoverrides
      caBundle: SERVICE_SERVING_CERT_CA
    rules:
      - operations:
          - CREATE
          - UPDATE
        apiGroups:
          - ""
        apiVersions:
          - "v1"
        resources:
          - "pods"
        scope: "Namespaced"
    failurePolicy: Fail
    timeoutSeconds: 5
    sideEffects: None
    reinvocationPolicy: IfNeeded
