apiVersion: apps/v1
kind: Deployment
metadata:
  name: managed-upgrade-operator
  namespace: openshift-managed-upgrade-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: managed-upgrade-operator
  template:
    metadata:
      labels:
        name: managed-upgrade-operator
    spec:
      serviceAccountName: managed-upgrade-operator
      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - preference:
              matchExpressions:
              - key: node-role.kubernetes.io/infra
                operator: Exists
            weight: 1
      tolerations:
        - operator: Exists
          key: node-role.kubernetes.io/infra
          effect: NoSchedule
      containers:
        - name: managed-upgrade-operator
          # Replace this with the built image name
          # This will get replaced on deploy by /hack/generate-operator-bundle.py
          image: quay.io/app-sre/managed-upgrade-operator:latest
          command:
          - managed-upgrade-operator
          imagePullPolicy: Always
          resources:
            requests:
              cpu: 5m
              memory: 50Mi
            limits:
              cpu: 20m
              memory: 100Mi
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: OPERATOR_NAME
              value: "managed-upgrade-operator"
