---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/instance: ibm-spectrum-scale-csi-operator
    app.kubernetes.io/managed-by: ibm-spectrum-scale-csi-operator
    app.kubernetes.io/name: ibm-spectrum-scale-csi-operator
    product: ibm-spectrum-scale-csi
    release: ibm-spectrum-scale-csi-operator
  name: ibm-spectrum-scale-csi-operator
  namespace: ibm-spectrum-scale-csi-driver
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: ibm-spectrum-scale-csi-operator
  template:
    metadata:
      annotations:
        productID: ibm-spectrum-scale-csi-operator
        productName: IBM Spectrum Scale CSI Operator
        productVersion: 2.0.0
      labels:
        app.kubernetes.io/instance: ibm-spectrum-scale-csi-operator
        app.kubernetes.io/managed-by: ibm-spectrum-scale-csi-operator
        app.kubernetes.io/name: ibm-spectrum-scale-csi-operator
        name: ibm-spectrum-scale-csi-operator
        product: ibm-spectrum-scale-csi
        release: ibm-spectrum-scale-csi-operator
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: beta.kubernetes.io/arch
                    operator: Exists
      containers:
        - env:
            - name: ANSIBLE_DEBUG_LOGS
              value: "False"
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: ibm-spectrum-scale-csi-operator
            - name: CSI_DRIVER_IMAGE
              value: quay.io/ibm-spectrum-scale/ibm-spectrum-scale-csi-driver:v2.0.0
          image: quay.io/ibm-spectrum-scale/ibm-spectrum-scale-csi-operator:v2.0.0
          imagePullPolicy: IfNotPresent
          livenessProbe:
            exec:
              command:
                - ./health_check.sh
            initialDelaySeconds: 10
            periodSeconds: 30
          name: operator
          readinessProbe:
            exec:
              command:
                - ./health_check.sh
            initialDelaySeconds: 3
            periodSeconds: 1
          resources:
            limits:
              cpu: 500m
              memory: 500Mi
            requests:
              cpu: 50m
              memory: 50Mi

          #hostNetwork: false
          #hostPID: false
          #hostIPC: false
          securityContext:
            runAsNonRoot: true
            runAsUser: 1001
            readOnlyRootFilesystem: false
            allowPrivilegeEscalation: false
            privileged: false
            capabilities:
              drop:
                - ALL
          volumeMounts:
            - mountPath: /tmp/ansible-operator/runner
              name: runner
      serviceAccountName: ibm-spectrum-scale-csi-operator
      volumes:
        - emptyDir: {}
          name: runner
