---
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: 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.4.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: kubernetes.io/arch
                    operator: Exists
      containers:
        - name: operator
          args:
            - "--metrics-addr=0.0.0.0:8383"
            - "--enable-leader-election"
            - "--leader-election-id=ibm-spectrum-scale-csi-operator"
          env:
            # do not remove: this is required SHORTNAME_NODE_MAPPING="yes" for split hostNetwork node mapping.
            - name: SHORTNAME_NODE_MAPPING
              value: "yes"
            - name: MAX_CONCURRENT_RECONCILES_CSISCALEOPERATOR_CSI_IBM_COM
              value: "1"
            - name: MAX_CONCURRENT_RECONCILES_SECRET_
              value: "1"
            - name: ANSIBLE_DEBUG_LOGS
              value: "False"
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: CSI_DRIVER_IMAGE
              value: cp.icr.io/cp/spectrum/scale/csi/ibm-spectrum-scale-csi-driver@sha256:4d8c41138f2fddac351f82db19c32fe5ad1282e7886f78fe2669f0c30ea5badb
            - name: CSI_SNAPSHOTTER_IMAGE
              value: cp.icr.io/cp/spectrum/scale/csi/csi-snapshotter@sha256:818f35653f2e214db81d655063e81995de9073328a3430498624c140881026a3
            - name: CSI_ATTACHER_IMAGE
              value: cp.icr.io/cp/spectrum/scale/csi/csi-attacher@sha256:80dec81b679a733fda448be92a2331150d99095947d04003ecff3dbd7f2a476a
            - name: CSI_PROVISIONER_IMAGE
              value: cp.icr.io/cp/spectrum/scale/csi/csi-provisioner@sha256:6477988532358148d2e98f7c747db4e9250bbc7ad2664bf666348abf9ee1f5aa
            - name: CSI_LIVENESSPROBE_IMAGE
              value: cp.icr.io/cp/spectrum/scale/csi/livenessprobe@sha256:529be2c9770add0cdd0c989115222ea9fc1be430c11095eb9f6dafcf98a36e2b
            - name: CSI_NODE_REGISTRAR_IMAGE
              value: cp.icr.io/cp/spectrum/scale/csi/csi-node-driver-registrar@sha256:f9bcee63734b7b01555ee8fc8fb01ac2922478b2c8934bf8d468dd2916edc405
            - name: CSI_RESIZER_IMAGE
              value: cp.icr.io/cp/spectrum/scale/csi/csi-resizer@sha256:6e0546563b18872b0aa0cad7255a26bb9a87cb879b7fc3e2383c867ef4f706fb
          image: icr.io/cpopen/ibm-spectrum-scale-csi-operator@sha256:38751e2b7a4624e588747ed427c2c2146bee320bab74b0bb288f38c2c5d2bddd
          imagePullPolicy: IfNotPresent
          livenessProbe:
            exec:
              command:
                - ./health_check.sh
            initialDelaySeconds: 10
            periodSeconds: 30
          readinessProbe:
            exec:
              command:
                - ./health_check.sh
            initialDelaySeconds: 3
            periodSeconds: 1
          resources:
            limits:
              cpu: 600m
              memory: 600Mi
              ephemeral-storage: 5Gi
            requests:
              cpu: 50m
              memory: 50Mi
              ephemeral-storage: 5Gi
          #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
