apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: openshift-etcd-operator
  name: etcd-operator
  annotations:
    include.release.openshift.io/self-managed-high-availability: "true"
    exclude.release.openshift.io/internal-openshift-hosted: "true"
  labels:
    app: etcd-operator
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: etcd-operator
  template:
    metadata:
      name: etcd-operator
      labels:
        app: etcd-operator
    spec:
      serviceAccountName: etcd-operator
      containers:
      - name: etcd-operator
        image: quay.io/openshift/origin-cluster-etcd-operator
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 8443
          name: metrics
          protocol: TCP
        command: ["cluster-etcd-operator", "operator"]
        args:
        - "--config=/var/run/configmaps/config/config.yaml"
        - "-v=4"
        - "--terminate-on-files=/var/run/secrets/serving-cert/tls.crt"
        - "--terminate-on-files=/var/run/secrets/serving-cert/tls.key"
        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/configmaps/etcd-ca
          name: etcd-ca
        - mountPath: /var/run/configmaps/etcd-service-ca
          name: etcd-service-ca
        - mountPath: /var/run/secrets/etcd-client
          name: etcd-client
        env:
        - name: IMAGE
          value: quay.io/openshift/origin-etcd
        - name: OPERATOR_IMAGE
          value: quay.io/openshift/origin-cluster-etcd-operator
        - name: OPERATOR_IMAGE_VERSION
          value: "0.0.1-snapshot"
        - name: OPERAND_IMAGE_VERSION
          value: "0.0.1-snapshot"
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        terminationMessagePolicy: FallbackToLogsOnError
      volumes:
      - name: serving-cert
        secret:
          secretName: etcd-operator-serving-cert
          optional: true
      - name: config
        configMap:
          name: etcd-operator-config
      - name: etcd-ca
        configMap:
          name: etcd-ca-bundle
      - name: etcd-service-ca
        configMap:
          name: etcd-service-ca-bundle
      - name: etcd-client
        secret:
          secretName: etcd-client
      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
