apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: openshift-kube-controller-manager-operator
  name: kube-controller-manager-operator
  labels:
    app: kube-controller-manager-operator
  annotations:
    include.release.openshift.io/self-managed-high-availability: "true"
    exclude.release.openshift.io/internal-openshift-hosted: "true"
    include.release.openshift.io/single-node-developer: "true"
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: kube-controller-manager-operator
  template:
    metadata:
      name: kube-controller-manager-operator
      annotations:
        target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
      labels:
        app: kube-controller-manager-operator
    spec:
      securityContext:
        runAsNonRoot: true
        runAsUser: 65534
        seccompProfile:
          type: RuntimeDefault
      automountServiceAccountToken: false
      serviceAccountName: kube-controller-manager-operator
      containers:
      - name: kube-controller-manager-operator
        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop: ["ALL"]
        image: docker.io/openshift/origin-cluster-kube-controller-manager-operator:v4.0
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 8443
          name: metrics
          protocol: TCP
        command: ["cluster-kube-controller-manager-operator", "operator"]
        args:
        - "--config=/var/run/configmaps/config/config.yaml"
        resources:
          requests:
            memory: 50Mi
            cpu: 10m
        volumeMounts:
        - mountPath: /var/run/configmaps/config
          name: config
        - mountPath: /var/run/secrets/serving-cert
          name: serving-cert
        - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
          name: kube-api-access
          readOnly: true
        env:
        - name: IMAGE
          value: quay.io/openshift/origin-hyperkube:v4.0
        - name: OPERATOR_IMAGE
          value: docker.io/openshift/origin-cluster-kube-controller-manager-operator:v4.0
        - name: CLUSTER_POLICY_CONTROLLER_IMAGE
          value: quay.io/openshift/origin-cluster-policy-controller:v4.3
        - name: TOOLS_IMAGE
          value: quay.io/openshift/origin-tools:latest
        - name: OPERATOR_IMAGE_VERSION
          value: "0.0.1-snapshot"
        - name: OPERAND_IMAGE_VERSION
          value: "0.0.1-snapshot-kubernetes"
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        terminationMessagePolicy: FallbackToLogsOnError
      volumes:
      - name: serving-cert
        secret:
          secretName: kube-controller-manager-operator-serving-cert
          optional: true
      - name: config
        configMap:
          name: kube-controller-manager-operator-config
      - name: kube-api-access
        projected:
          defaultMode: 420
          sources:
          - serviceAccountToken:
              expirationSeconds: 3600
              path: token
          - configMap:
              items:
              - key: ca.crt
                path: ca.crt
              name: kube-root-ca.crt
          - downwardAPI:
              items:
              - fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.namespace
                path: namespace
      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 
