apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: openshift-csr-approver
  name: csr-approver
  labels:
    app: openshift-csr-approver
    csr-approver: "true"
spec:
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: openshift-csr-approver
      csr-approver: "true"
  template:
    metadata:
      name: csr-approver
      labels:
        app: openshift-csr-approver
        csr-approver: "true"
    spec:
      serviceAccountName: csr-approver-sa
      containers:
      - name: csr-approver-controller
        image: ${IMAGE}
        imagePullPolicy: Always
        command: ["csr-approver", "csr-approver"]
        args:
        - "--config=/var/run/configmaps/config/controller-config.yaml"
        ports:
        - containerPort: 8443
        volumeMounts:
        - mountPath: /var/run/configmaps/config
          name: config
        - mountPath: /var/run/secrets/serving-cert
          name: serving-cert
      volumes:
      - name: serving-cert
        secret:
          secretName: csr-approver-serving-cert
          optional: true
      - name: config
        configMap:
          name: csr-approver-config
      nodeSelector:
        node-role.kubernetes.io/master: ""
      tolerations:
      - operator: Exists
