Kubernetes Helm Chart with multiple PV for data path

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

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 to fix up the default values and documentation to make this clearer.

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.

2 Likes

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