apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: openshift-apiserver-operator
  name: openshift-apiserver-operator
  labels:
    app: openshift-apiserver-operator
  annotations:
    include.release.openshift.io/self-managed-high-availability: "true"
    include.release.openshift.io/single-node-developer: "true"
    exclude.release.openshift.io/internal-openshift-hosted: "true"
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: openshift-apiserver-operator
  template:
    metadata:
      name: openshift-apiserver-operator
      labels:
        app: openshift-apiserver-operator
      annotations:
        target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
    spec:
      securityContext:
        runAsNonRoot: true
        runAsUser: 65534
        seccompProfile:
          type: RuntimeDefault
      serviceAccountName: openshift-apiserver-operator
      containers:
      - name: openshift-apiserver-operator
        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop: ["ALL"]
        terminationMessagePolicy: FallbackToLogsOnError
        image: quay.io/openshift/origin-cluster-openshift-apiserver-operator:v4.2
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 8443
          name: metrics
          protocol: TCP
        command: ["cluster-openshift-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-openshift-apiserver:v4.2
        - name: OPERATOR_IMAGE
          value: quay.io/openshift/origin-cluster-openshift-apiserver-operator:v4.2
        - name: OPERATOR_IMAGE_VERSION
          value: "0.0.1-snapshot"
        - name: OPERAND_IMAGE_VERSION
          value: "0.0.1-snapshot"
        - name: KUBE_APISERVER_OPERATOR_IMAGE
          value: docker.io/openshift/origin-cluster-kube-apiserver-operator:latest
      volumes:
      - name: serving-cert
        secret:
          secretName: openshift-apiserver-operator-serving-cert
          optional: true
      - name: config
        configMap:
          name: openshift-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
