# Kubernetes Helm Chart with multiple PV for data path

**URL:** <https://discuss.elastic.co/t/kubernetes-helm-chart-with-multiple-pv-for-data-path/190438>\
**Category:** Elasticsearch\
**Created:** [July 15, 2019, 7:00am UTC](https://discuss.elastic.co/t/kubernetes-helm-chart-with-multiple-pv-for-data-path/190438 "2019-07-15T07:00:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tgruenert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tgruenert/32/52530_2.png) [@tgruenert](https://discuss.elastic.co/u/tgruenert)\
**Post date:** [July 15, 2019, 7:00am UTC](https://discuss.elastic.co/t/kubernetes-helm-chart-with-multiple-pv-for-data-path/190438/1 "2019-07-15T07:00:27Z")

</div>

Hi there,

is there any template or solution for defining multiple data paths within a helm chart?  
The question is not only about the env variable, which i am able to handle.

The problem is more about defining extra volumes for different locations while storage is done on bare metal kuberentes installations (PV with hostPath location).

How should I define a secondary PV as extra volume or volumeMount? How can I do this in a kind that we are keeping able to scale the solution (more nodes, not necessary more data paths per node).

Any hints would be nice.

Thank you a lot!  
Thomas

---

<div class="post-metadata">

**Author:** ![michael.russell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael.russell/32/27889_2.png) [@michael.russell](https://discuss.elastic.co/u/michael.russell)\
**Post date:** [July 31, 2019, 5:12pm UTC](https://discuss.elastic.co/t/kubernetes-helm-chart-with-multiple-pv-for-data-path/190438/2 "2019-07-31T17:12:47Z")

</div>

Did you already try to configure this with the `extraVolumes` and `extraVolumeMounts` values? Both of these are string values passed to the `tmpl` function so you should be able to mount pod specific volumes this way. I have an [open PR](https://github.com/elastic/helm-charts/pull/238) to fix up the default values and documentation to make this clearer.

> <https://github.com/elastic/helm-charts/blob/e404fb7eb22729bf2b62d1833f84728073d5ace0/elasticsearch/values.yaml#L93-L100>

---

<div class="post-metadata">

**Author:** ![tgruenert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tgruenert/32/52530_2.png) [@tgruenert](https://discuss.elastic.co/u/tgruenert)\
**Post date:** [August 19, 2019, 7:25am UTC](https://discuss.elastic.co/t/kubernetes-helm-chart-with-multiple-pv-for-data-path/190438/3 "2019-08-19T07:25:12Z")

</div>

Indeed defining extraVolumes and extraVolumeMounts are the key. See the persistence=false flag which can be confusing!

my solution (as an answer to myself)

```
  elasticsearch:
    persistence:
        enabled: false
    extraEnvs:
      - name: path.data
        value: /usr/share/elasticsearch/data1,/usr/share/elasticsearch/data2
    extraVolumes: |
      - name: data1
        hostPath:
          path: /hostdata1/
          type: DirectoryOrCreate
      - name: data2
        hostPath:
          path: /hostdata2/
          type: DirectoryOrCreate

     extraVolumeMounts: |
      - name: data1
        mountPath: /usr/share/elasticsearch/data1
      - name: data2
        mountPath: /usr/share/elasticsearch/data2

```

Maybe somebody see a less confuse solution where disabling persistence is not mandatory any longer.

---

<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:** [September 16, 2019, 7:25am UTC](https://discuss.elastic.co/t/kubernetes-helm-chart-with-multiple-pv-for-data-path/190438/4 "2019-09-16T07:25:15Z")

</div>

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