kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: csi-rhm-cos-ss
  namespace: ${NAMESPACE}
spec:
  serviceName: csi-rhm-cos-ss
  replicas: 1
  selector:
    matchLabels:
      app: csi-rhm-cos-ss
  template:
    metadata:
      labels:
        app: csi-rhm-cos-ss
        "csi.marketplace.redhat.com/driverVersion": "${DRIVER_VERSION}"
    spec:
      serviceAccount: csi-rhm-cos
      priorityClassName: system-node-critical
      containers:
      - name: csi-attacher
        image: registry.redhat.io/openshift4/ose-csi-external-attacher:v4.7.0
        args:
        - "--csi-address=$(ADDRESS)"
        - "--v=5"
        env:
        - name: ADDRESS
          value: /var/lib/csi/sockets/pluginproxy/csi.sock
        imagePullPolicy: IfNotPresent
        volumeMounts:
        - name: socket-dir
          mountPath: /var/lib/csi/sockets/pluginproxy/
      - name: csi-provisioner
        image: registry.redhat.io/openshift4/ose-csi-external-provisioner:v4.7.0
        args:
        - "--extra-create-metadata"
        - "--csi-address=$(ADDRESS)"
        - "--v=5"
        env:
        - name: ADDRESS
          value: /var/lib/csi/sockets/pluginproxy/csi.sock
        imagePullPolicy: IfNotPresent
        volumeMounts:
        - name: socket-dir
          mountPath: /var/lib/csi/sockets/pluginproxy/
      - name: csi-rhm-cos
        image: "${DRIVER_IMAGE}:${DRIVER_VERSION}"
        imagePullPolicy: IfNotPresent
        securityContext:
          allowPrivilegeEscalation: true
          privileged: true
          capabilities:
            add: ["SYS_ADMIN"]
        args:
        - "--node-name=$(KUBE_NODE_NAME)"
        - "--csi-endpoint=unix://$(ADDRESS)"
        - "--v=5"
        envFrom:
        - configMapRef:
            name: csi-rhm-cos-env
        env:
        - name: ADDRESS
          value: /var/lib/csi/sockets/pluginproxy/csi.sock
        - name: KUBE_NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        volumeMounts:
        - mountPath: /var/lib/csi/sockets/pluginproxy/
          name: socket-dir
      volumes:
      - name: socket-dir
        emptyDir: {}