---
apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: machine-api-operator
  namespace: openshift-machine-api
  labels:
    k8s-app: machine-api-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      k8s-app: machine-api-operator
  template:
    metadata:
      labels:
        k8s-app: machine-api-operator
    spec:
      priorityClassName: system-node-critical
      serviceAccountName: machine-api-operator
      containers:
      - name: kube-rbac-proxy
        image: quay.io/openshift/origin-kube-rbac-proxy:4.2.0
        args:
        - "--secure-listen-address=0.0.0.0:8443"
        - "--upstream=http://localhost:8080/"
        - "--config-file=/etc/kube-rbac-proxy/config-file.yaml"
        - "--logtostderr=true"
        - "--v=10"
        ports:
        - containerPort: 8443
          name: https
        resources:
          requests:
            memory: 20Mi
            cpu: 10m
        volumeMounts:
        - name: config
          mountPath: /etc/kube-rbac-proxy
      - name: machine-api-operator
        image: docker.io/openshift/origin-machine-api-operator:v4.0.0
        command:
        - "/machine-api-operator"
        args:
        - "start"
        - "--images-json=/etc/machine-api-operator-config/images/images.json"
        - "--alsologtostderr"
        - "--v=3"
        env:
        - name: RELEASE_VERSION
          value: "0.0.1-snapshot"
        - name: COMPONENT_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: METRICS_PORT
          value: "8080"
        resources:
          requests:
            cpu: 10m
            memory: 50Mi
        volumeMounts:
        - name: images
          mountPath: /etc/machine-api-operator-config/images
      nodeSelector:
        node-role.kubernetes.io/master: ""
      restartPolicy: Always
      securityContext:
        runAsNonRoot: true
        runAsUser: 65534
      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
      volumes:
      - name: config
        configMap:
          name: kube-rbac-proxy
      - name: images
        configMap:
          name: machine-api-operator-images
