apiVersion: apps/v1
kind: Deployment
metadata:
  name: glusterfs-client-provisioner
  labels:
    app: glusterfs-client-provisioner
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: glusterfs-client-provisioner
  template:
    metadata:
      labels:
        app: glusterfs-client-provisioner
    spec:
      serviceAccountName: glusterfs-client-provisioner
      containers:
        - name: glusterfs-client-provisioner
          image: olliai/glusterfs-client-provisioner:latest
          volumeMounts:
            - name: glusterfs-client-root
              mountPath: /persistentvolumes
          env:
            - name: NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: PROVISIONER_NAME
              value: cluster.local/glusterfs
            - name: GLUSTERFS_ENDPOINTS
              value: glusterfs-client-provisioner
            - name: GLUSTERFS_PATH
              value: volume/kubedata
      volumes:
        - name: glusterfs-client-root
          glusterfs:
            endpoints: glusterfs-client-provisioner
            path: volume/kubedata
