apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: openshift-controller-manager-operator
  name: openshift-controller-manager-operator
  labels:
    app: openshift-controller-manager-operator
  annotations:
    include.release.openshift.io/self-managed-high-availability: "true"
    exclude.release.openshift.io/internal-openshift-hosted: "true"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: openshift-controller-manager-operator
  template:
    metadata:
      name: openshift-controller-manager-operator
      labels:
        app: openshift-controller-manager-operator
    spec:
      serviceAccountName: openshift-controller-manager-operator
      containers:
      - name: openshift-controller-manager-operator
        image: docker.io/openshift/origin-cluster-openshift-controller-manager-operator:v4.0
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 8443
          name: metrics
          protocol: TCP
        command: ["cluster-openshift-controller-manager-operator", "operator"]
        args:
        - "--config=/var/run/configmaps/config/config.yaml"
        - "-v=4"
        resources:
          requests:
            memory: 50Mi
            cpu: 10m
        volumeMounts:
        - mountPath: /var/run/configmaps/config
          name: config
        - mountPath: /var/run/secrets/serving-cert
          name: serving-cert
        env:
        - name: RELEASE_VERSION
          value: "0.0.1-snapshot"
        - name: IMAGE
          value: quay.io/openshift/origin-openshift-controller-manager:v4.2
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        terminationMessagePolicy: FallbackToLogsOnError
      volumes:
      - name: serving-cert
        secret:
          defaultMode: 400
          secretName: openshift-controller-manager-operator-serving-cert
          optional: true
      - name: config
        configMap:
          defaultMode: 440
          name: openshift-controller-manager-operator-config
      nodeSelector:
        node-role.kubernetes.io/master: ""
      priorityClassName: "system-cluster-critical"
      tolerations:
      - key: node-role.kubernetes.io/master  
        operator: Exists
        effect: "NoSchedule"
      - key: "node.kubernetes.io/unreachable"
        operator: "Exists"
        effect: "NoExecute"
        tolerationSeconds: 120 
      - key: "node.kubernetes.io/not-ready"
        operator: "Exists"
        effect: "NoExecute"
        tolerationSeconds: 120
