apiVersion: apps/v1
kind: Deployment
metadata:
  name: cluster-storage-operator
  namespace: openshift-cluster-storage-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: cluster-storage-operator
  template:
    metadata:
      labels:
        name: cluster-storage-operator
    spec:
      nodeSelector:
        node-role.kubernetes.io/master: ""
      tolerations:
      - key: node-role.kubernetes.io/master  # Just tolerate NoSchedule taint on master node. If there are other conditions like disk-pressure etc, let's not schedule the control-plane pods onto that node.
        operator: Exists
        effect: "NoSchedule"
      - key: "node.kubernetes.io/unreachable"
        operator: "Exists"
        effect: "NoExecute"
        tolerationSeconds: 120 # Evict pods within 2 mins.
      - key: "node.kubernetes.io/not-ready"
        operator: "Exists"
        effect: "NoExecute"
        tolerationSeconds: 120 # Evict pods within 2 mins.
      priorityClassName: system-cluster-critical
      serviceAccountName: cluster-storage-operator
      containers:
        - name: cluster-storage-operator
          image: openshift/origin-cluster-storage-operator:latest
          terminationMessagePolicy: FallbackToLogsOnError
          ports:
          - containerPort: 60000
            name: metrics
          command:
          - cluster-storage-operator
          imagePullPolicy: IfNotPresent
          env:
            - name: RELEASE_VERSION
              value: "0.0.1-snapshot"
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "storage"
          resources:
            requests:
              cpu: 10m
              memory: 20Mi
