# External provisioner is not creating volume

**URL:** <https://discuss.elastic.co/t/external-provisioner-is-not-creating-volume/285762>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [October 3, 2021, 8:48am UTC](https://discuss.elastic.co/t/external-provisioner-is-not-creating-volume/285762 "2021-10-03T08:48:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![HoseinGhanbari](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@HoseinGhanbari](https://discuss.elastic.co/u/HoseinGhanbari)\
**Post date:** [October 3, 2021, 8:48am UTC](https://discuss.elastic.co/t/external-provisioner-is-not-creating-volume/285762/1 "2021-10-03T08:48:32Z")

</div>

Recently deployed a brand new **ECK** and **Elasticsearch Cluster** using the [official quickstart guide](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-quickstart.html). but my external provisioner which is a `NFS` server through custom `StorageClass` is not creating the volume for `Elasticsearch Cluster`. Let me know if I am doing wrong something. Any help would be appreciated.

```auto
waiting for a volume to be created, either by external provisioner "nfs-mavara-du" or manually created by system administrator

```

```auto
kubectl get all -n elastic-system

NAME READY STATUS RESTARTS AGE
pod/elastic-operator-0 1/1 Running 11 24h
pod/nfs-pod-provisioner-857b88ff47-hd7x9 1/1 Running 0 137m
pod/quickstart-es-default-0 0/1 Pending 0 41m

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/elastic-webhook-server ClusterIP 10.233.51.69 <none> 443/TCP 25h
service/quickstart-es-default ClusterIP None <none> 9200/TCP 41m
service/quickstart-es-http ClusterIP 10.233.49.195 <none> 9200/TCP 41m
service/quickstart-es-transport ClusterIP None <none> 9300/TCP 41m

NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/nfs-pod-provisioner 1/1 1 1 137m

NAME DESIRED CURRENT READY AGE
replicaset.apps/nfs-pod-provisioner-857b88ff47 1 1 1 137m

NAME READY AGE
statefulset.apps/elastic-operator 1/1 25h
statefulset.apps/quickstart-es-default 0/1 41m

```

```auto
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: quickstart
spec:
  version: 7.15.0
  nodeSets:
  - name: default
    count: 1
    config:
      node.store.allow_mmap: false
    volumeClaimTemplates:
    - metadata:
        name: elasticsearch-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 1Gi
        storageClassName: nfs-storageclass2
        volumeMode: Filesystem

```

```auto
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: nfs-storageclass2
parameters:
  archiveOnDelete: "false"
provisioner: nfs-mavara-du
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer

```

```auto
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nfs-pod-provisioner
  labels:
    app: nfs-pod-provisioner
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: nfs-pod-provisioner
  template:
    metadata:
      labels:
        app: nfs-pod-provisioner
    spec:
      serviceAccountName: nfs-pod-provisioner-sa # name of service account created in rbac.yaml
      containers:
        - name: nfs-pod-provisioner
          image: quay.io/external_storage/nfs-client-provisioner:latest
          volumeMounts:
            - name: nfs-provisioner-v
              mountPath: /persistentvolumes
          env:
            - name: PROVISIONER_NAME # do not change
              value: nfs-mavara-du # SAME AS PROVISONER NAME VALUE IN STORAGECLASS
            - name: NFS_SERVER # do not change
              value: 10.10.20.10 # Ip of the NFS SERVER
            - name: NFS_PATH # do not change
              value: /dnfs # path to nfs directory setup
      volumes:
       - name: nfs-provisioner-v # same as volumemouts name
         nfs:
           server: 10.10.20.10
           path: /dnfs

```

```auto
kind: ServiceAccount
apiVersion: v1
metadata:
  name: nfs-pod-provisioner-sa
---
kind: ClusterRole # Role of kubernetes
apiVersion: rbac.authorization.k8s.io/v1 # auth API
metadata:
  name: nfs-provisioner-clusterRole
rules:
  - apiGroups: [""] # rules on persistentvolumes
    resources: ["persistentvolumes"]
    verbs: ["get", "list", "watch", "create", "delete"]
  - apiGroups: [""]
    resources: ["persistentvolumeclaims"]
    verbs: ["get", "list", "watch", "update"]
  - apiGroups: ["storage.k8s.io"]
    resources: ["storageclasses"]
    verbs: ["get", "list", "watch"]
  - apiGroups: [""]
    resources: ["events"]
    verbs: ["create", "update", "patch"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: nfs-provisioner-rolebinding
subjects:
  - kind: ServiceAccount
    name: nfs-pod-provisioner-sa # defined on top of file
    namespace: elastic-system
roleRef: # binding cluster role to service account
  kind: ClusterRole
  name: nfs-provisioner-clusterRole # name defined in clusterRole
  apiGroup: rbac.authorization.k8s.io
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: nfs-pod-provisioner-otherRoles
rules:
  - apiGroups: [""]
    resources: ["endpoints"]
    verbs: ["get", "list", "watch", "create", "update", "patch"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: nfs-pod-provisioner-otherRoles
subjects:
  - kind: ServiceAccount
    name: nfs-pod-provisioner-sa # same as top of the file
    # replace with namespace where provisioner is deployed
    namespace: elastic-system
roleRef:
  kind: Role
  name: nfs-pod-provisioner-otherRoles
  apiGroup: rbac.authorization.k8s.io

```

---

<div class="post-metadata">

**Author:** ![HoseinGhanbari](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@HoseinGhanbari](https://discuss.elastic.co/u/HoseinGhanbari)\
**Post date:** [October 3, 2021, 9:42am UTC](https://discuss.elastic.co/t/external-provisioner-is-not-creating-volume/285762/2 "2021-10-03T09:42:13Z")

</div>

Unfortunately a simple standalone `PVC` which uses the same `StorageClass` could not creating the `PV` through the same `external provisioner`.

```auto
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: nfs-pvc-test
spec:
  storageClassName: nfs-storageclass
  volumeMode: Filesystem
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 50Mi

```

```auto
kubectl -n elastic-system describe pvc/nfs-pvc-test

Name: nfs-pvc-test
Namespace: elastic-system
StorageClass: nfs-storageclass
Status: Pending
Volume:
Labels: <none>
Annotations: volume.beta.kubernetes.io/storage-provisioner: nfs-mavara-du
Finalizers: [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
VolumeMode: Filesystem
Used By: <none>
Events:
  Type Reason Age From Message
  ---- ------ ---- ---- -------
  Normal ExternalProvisioning 15s (x12 over 2m39s) persistentvolume-controller waiting for a volume to be created, either by external provisioner "nfs-mavara-du" or manually created by system administrator

```

---

<div class="post-metadata">

**Author:** ![pebrc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pebrc/32/101790_2.png) [@pebrc](https://discuss.elastic.co/u/pebrc)\
**Post date:** [October 4, 2021, 8:50am UTC](https://discuss.elastic.co/t/external-provisioner-is-not-creating-volume/285762/3 "2021-10-04T08:50:14Z")

</div>

I can't really help with the NFS storage provisioner and it would probably be good to engage with NFS provisioner project. I noticed however that the nfs-client-provisioner project is deprecated.

There is another more fundamental issue here and that is that it is not recommended to use NFS volumes for the Elasticsearch data volume to begin with. This [discussion thread](https://discuss.elastic.co/t/why-nfs-is-to-be-avoided-for-data-directories/215240/3) offers a bit more context as to why that is the case and it is also mentioned in the [Elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/7.15/tune-for-indexing-speed.html),

---

<div class="post-metadata">

**Author:** ![HoseinGhanbari](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@HoseinGhanbari](https://discuss.elastic.co/u/HoseinGhanbari)\
**Post date:** [October 4, 2021, 9:49am UTC](https://discuss.elastic.co/t/external-provisioner-is-not-creating-volume/285762/4 "2021-10-04T09:49:06Z")

</div>

Thank you for your answer. I will switch to [`nfs-subdir-external-provisioner`](https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner) which is currently the best alternative nfs provisioner available.

Could you please let me know what alternative solution do I have for a `distributed/shared storage among entire cluster` as the NFS can introduces performance issues?

---

<div class="post-metadata">

**Author:** ![pebrc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pebrc/32/101790_2.png) [@pebrc](https://discuss.elastic.co/u/pebrc)\
**Post date:** [October 4, 2021, 11:44am UTC](https://discuss.elastic.co/t/external-provisioner-is-not-creating-volume/285762/5 "2021-10-04T11:44:58Z")

</div>

This depends a lot on the environment you are running in. If you are running your cluster on one of the Cloud providers or are using a hosted Kubernetes offering then there are typically already storage provisioners available for example EBS backed volumes on AWS and persistent disks on GCE.

If you are running on premise then there are many options to choose from that it is hard to make a recommendation without knowing a lot more about the context.

You mentioned `shared` storage, I think it is worth pointing out that using shared storage (as NFS implements it) is not necessary or desirable for Elasticsearch. Each Elasticsearch node needs its own data volume that must not be shared with other nodes. If you need ultimate performance then local storage is also an option. [OpenEBS](https://openebs.io) for example offers different data engines for both local and network attached storage.

We have [Storage recommendations | Elastic Cloud on Kubernetes [1.8] | Elastic](https://www.elastic.co/guide/en/cloud-on-k8s/1.8/k8s-storage-recommendations.html) in the ECK documentation with some further guidance.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 1, 2021, 11:45am UTC](https://discuss.elastic.co/t/external-provisioner-is-not-creating-volume/285762/6 "2021-11-01T11:45:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
