apiVersion: apps/v1
kind: Deployment
metadata:
  name: machine-api-operator
  namespace: openshift-machine-api
  labels:
    k8s-app: machine-api-operator
  annotations:
    exclude.release.openshift.io/internal-openshift-hosted: "true"
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: registry.svc.ci.openshift.org/openshift:kube-rbac-proxy
        args:
        - "--secure-listen-address=0.0.0.0:8443"
        - "--upstream=http://localhost:8080/"
        - "--tls-cert-file=/etc/tls/private/tls.crt"
        - "--tls-private-key-file=/etc/tls/private/tls.key"
        - "--config-file=/etc/kube-rbac-proxy/config-file.yaml"
        - "--logtostderr=true"
        - "--v=10"
        ports:
        - containerPort: 8443
          name: https
          protocol: TCP
        resources:
          requests:
            memory: 20Mi
            cpu: 10m
        volumeMounts:
        - name: config
          mountPath: /etc/kube-rbac-proxy
        - mountPath: /etc/tls/private
          name: machine-api-operator-tls
      - name: machine-api-operator
        image: registry.svc.ci.openshift.org/openshift:machine-api-operator
        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:
              apiVersion: v1
              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
      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
          defaultMode: 420
      - name: images
        configMap:
          defaultMode: 420
          name: machine-api-operator-images
      - name: machine-api-operator-tls
        secret:
          defaultMode: 420
          secretName: machine-api-operator-tls
