apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: fsx-csi-controller
  namespace: kubeflow
spec:
  replicas: 1
  selector:
    matchLabels:
      app: fsx-csi-controller
  serviceName: fsx-csi-controller
  template:
    metadata:
      annotations:
        sidecar.istio.io/inject: "false"
      labels:
        app: fsx-csi-controller
    spec:
      containers:
      - args:
        - --endpoint=$(CSI_ENDPOINT)
        - --logtostderr
        - --v=5
        env:
        - name: CSI_ENDPOINT
          value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
        image: amazon/aws-fsx-csi-driver:latest
        name: fsx-plugin
        volumeMounts:
        - mountPath: /var/lib/csi/sockets/pluginproxy/
          name: socket-dir
      - 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
        image: quay.io/k8scsi/csi-provisioner:v0.4.2
        name: csi-provisioner
        volumeMounts:
        - mountPath: /var/lib/csi/sockets/pluginproxy/
          name: socket-dir
      - args:
        - --csi-address=$(ADDRESS)
        - --v=5
        env:
        - name: ADDRESS
          value: /var/lib/csi/sockets/pluginproxy/csi.sock
        image: quay.io/k8scsi/csi-attacher:v0.4.2
        name: csi-attacher
        volumeMounts:
        - mountPath: /var/lib/csi/sockets/pluginproxy/
          name: socket-dir
      serviceAccount: fsx-csi-controller-sa
      tolerations:
      - key: CriticalAddonsOnly
        operator: Exists
      volumes:
      - emptyDir: {}
        name: socket-dir
