# ECK with NFS shared persistent volume

**URL:** <https://discuss.elastic.co/t/eck-with-nfs-shared-persistent-volume/221073>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [February 26, 2020, 4:00pm UTC](https://discuss.elastic.co/t/eck-with-nfs-shared-persistent-volume/221073 "2020-02-26T16:00:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SergeyK](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@SergeyK](https://discuss.elastic.co/u/SergeyK)\
**Post date:** [February 26, 2020, 4:00pm UTC](https://discuss.elastic.co/t/eck-with-nfs-shared-persistent-volume/221073/1 "2020-02-26T16:00:08Z")

</div>

Hi,  
Did somebody manage to deploy Elasticserach with shared NFS volume (one volume for all pods)? All my nodes are in VMs (above private lab bare metal servers). There is dedicated NFS server created and all k8s nodes have mounts to it.  
Most common error is:

`ProvisioningFailed persistentvolumeclaim/elasticsearch-data-elasticsearch-candidate-es-master-1 storageclass.storage.k8s.io "standard" not found`

But _volume_ with _storageclass_ standard is there (_kubectl get pv_ shows it). I managed to deploy one master node only and it sees NFS directory (I see "nodes/0" directory created by ECK) but when I add a new master or data nodes, everything becomes in pending status (pods/containers are not created so I cannot "_kubectl logs pod\_name_"). I tried NFS 3 and 4.

volume definition example:

```
metadata:
  name: standard
spec:
  capacity:
    storage: 10Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Recycle
  storageClassName: standard
  nfs:
    path: /mnt/elasticdata
    server: 123.45.67.89

```

claim example:

```
volumeClaimTemplates:
- metadata:
    name: elasticsearch-data
  spec:
    accessModes:
    - ReadWriteMany
    resources:
      requests:
        storage: 2Gi
    storageClassName: standard	

```

BTW, is it good idea to use shared volume for all elasticsearch data nodes?

---

<div class="post-metadata">

**Author:** ![Anya\_Sabo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anya_sabo/32/49903_2.png) [@Anya\_Sabo](https://discuss.elastic.co/u/Anya_Sabo)\
**Post date:** [February 26, 2020, 9:54pm UTC](https://discuss.elastic.co/t/eck-with-nfs-shared-persistent-volume/221073/2 "2020-02-26T21:54:54Z")

</div>

I've never used NFS + Kubernetes before, so hopefully someone else can chime in. That said, this isn't necessarily ECK-specific, so you may be able to look for resources elsewhere for people using NFS with stateful sets if someone isn't able to help you out here.

---

<div class="post-metadata">

**Author:** ![SergeyK](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@SergeyK](https://discuss.elastic.co/u/SergeyK)\
**Post date:** [February 26, 2020, 10:21pm UTC](https://discuss.elastic.co/t/eck-with-nfs-shared-persistent-volume/221073/3 "2020-02-26T22:21:40Z")

</div>

Thanks @Anya_Sabo for your response. My other workloads work well with NFS, I am assuming that it's just not supported in ECK yet. Could you please recommend what kind of storage (except public cloud services) to use with ECK? In terms of performance and persistence, would emptyDir work (is it replicated if i use 1+ data nodes) or data goes way with pods ?  
Thanks again

---

<div class="post-metadata">

**Author:** ![sebgl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebgl/32/48702_2.png) [@sebgl](https://discuss.elastic.co/u/sebgl)\
**Post date:** [March 2, 2020, 9:29am UTC](https://discuss.elastic.co/t/eck-with-nfs-shared-persistent-volume/221073/4 "2020-03-02T09:29:45Z")

</div>

@SergeyK we generally recommend not using NFS for Elasticsearch data, mostly because of poor performance.

EmptyDir works, but we also don't recommend it. Every time a Pod gets deleted or recreated (eg. a Pod upgrade or host goes down), you will loose data. Which is fine in some situations since Elasticsearch replication will kick in and restore the missing data, but still risky if you loose several Pods at once.

I would encourage you to look at local PersistentVolumes.  
Some options:

- [create them manually](https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/#create-a-persistentvolume)
- [use a static provisioner](https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner) to auto-create them from available disks
- [use TopoLVM](https://github.com/cybozu-go/topolvm) to dynamically provision LVM-based volumes
- use a container attached storage solution such as [OpenEBS](https://github.com/openebs/openebs)

---

<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 4, 2022, 7:46am UTC](https://discuss.elastic.co/t/eck-with-nfs-shared-persistent-volume/221073/5 "2022-11-04T07:46:50Z")

</div>


