apiVersion: apps/v1
kind: Deployment
metadata:
  name: shared-resource-csi-driver-webhook
  namespace: openshift-cluster-csi-drivers
spec:
  replicas: 1
  selector:
    matchLabels:
      name: shared-resource-csi-driver-webhook
  strategy: {}
  template:
    metadata:
      annotations:
        target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
      labels:
        name: shared-resource-csi-driver-webhook
    spec:
      containers:
      - image: ${WEBHOOK_IMAGE}
        imagePullPolicy: IfNotPresent
        name: shared-resource-csi-driver-webhook
        volumeMounts:
        - name: trusted-ca-bundle
          mountPath: /etc/pki/ca-trust/extracted/pem
        - mountPath: /var/run/secrets/serving-cert
          name: shared-resource-csi-driver-webhook-serving-cert
        ports:
        - name: webhook
          containerPort: 5000
          protocol: TCP
        resources:
          requests:
            cpu: 10m
            memory: 20Mi
      priorityClassName: system-cluster-critical
      serviceAccountName: shared-resource-csi-driver-webhook
      nodeSelector:
        node-role.kubernetes.io/master: ""
      tolerations:
      - key: CriticalAddonsOnly
        operator: Exists
      - key: node-role.kubernetes.io/master
        operator: Exists
        effect: "NoSchedule"
      volumes:
      - name: shared-resource-csi-driver-webhook-serving-cert
        secret:
          defaultMode: 420
          secretName: shared-resource-csi-driver-webhook-serving-cert
      - name: trusted-ca-bundle
        configMap:
          name: shared-resource-csi-driver-operator-trusted-ca-bundle
          items:
            - key: ca-bundle.crt
              path: tls-ca-bundle.pem
