kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: fsx-csi-controller
spec:
  serviceName: fsx-csi-controller
  replicas: 1
  selector:
    matchLabels:
      app: fsx-csi-controller
  template:
    metadata:
      labels:
        app: fsx-csi-controller
    spec:
      serviceAccount: fsx-csi-controller-sa
#      priorityClassName: system-cluster-critical
      tolerations:
        - key: CriticalAddonsOnly
          operator: Exists
      containers:
        - name: fsx-plugin
          image: amazon/aws-fsx-csi-driver:latest
          args :
            - --endpoint=$(CSI_ENDPOINT)
            - --logtostderr
            - --v=5
          env:
            - name: CSI_ENDPOINT
              value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
          volumeMounts:
            - name: socket-dir
              mountPath: /var/lib/csi/sockets/pluginproxy/
        - name: csi-provisioner
          image: quay.io/k8scsi/csi-provisioner:v0.4.2
          args:
            - --provisioner=fsx.csi.aws.com
            - --csi-address=$(ADDRESS)
            - --connection-timeout=5m
            - --v=5
          env:
            - name: ADDRESS
              value: /var/lib/csi/sockets/pluginproxy/csi.sock
          volumeMounts:
            - name: socket-dir
              mountPath: /var/lib/csi/sockets/pluginproxy/
        - name: csi-attacher
          image: quay.io/k8scsi/csi-attacher:v0.4.2
          args:
            - --csi-address=$(ADDRESS)
            - --v=5
          env:
            - name: ADDRESS
              value: /var/lib/csi/sockets/pluginproxy/csi.sock
          volumeMounts:
            - name: socket-dir
              mountPath: /var/lib/csi/sockets/pluginproxy/
      volumes:
        - name: socket-dir
          emptyDir: {}
