apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: openshift-kube-apiserver-operator
  name: kube-apiserver-operator
  labels:
    app: kube-apiserver-operator
  annotations:
    exclude.release.openshift.io/internal-openshift-hosted: "true"
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: kube-apiserver-operator
  template:
    metadata:
      name: kube-apiserver-operator
      labels:
        app: kube-apiserver-operator
    spec:
      serviceAccountName: kube-apiserver-operator
      containers:
      - name: kube-apiserver-operator
        image: docker.io/openshift/origin-cluster-kube-apiserver-operator:v4.0
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 8443
          name: metrics
          protocol: TCP
        command: ["cluster-kube-apiserver-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
        env:
        - name: IMAGE
          value: quay.io/openshift/origin-hyperkube:v4.0
        - name: OPERATOR_IMAGE
          value: docker.io/openshift/origin-cluster-kube-apiserver-operator:v4.0
        - name: OPERAND_IMAGE_VERSION
          value: "0.0.1-snapshot-kubernetes"
        - name: OPERATOR_IMAGE_VERSION
          value: "0.0.1-snapshot"
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        terminationMessagePolicy: FallbackToLogsOnError
      volumes:
      - name: serving-cert
        secret:
          secretName: kube-apiserver-operator-serving-cert
          optional: true
      - name: config
        configMap:
          name: kube-apiserver-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 
