Unable to make elasticsearch as persistent volume in kubernetes cluster

4/12/2019

I want to setup Elasticsearch on Kubernetes Cluster using Helm. I can setup Elasticsearch on Kubernetes Cluster without persistence. I am using below helm chart.

helm install --name elasticsearch incubator/elasticsearch \
    --set master.persistence.enabled=false \
    --set data.persistence.enabled=false \
    --set image.tag=6.4.2 \
    --namespace logging

However, i am not able to use it with Persistence. Moreover i am confused as i am using neither cloud based storage(aws,gce) nor nfs. I am using Local VM storage. I added disk in my VM environment formated it under ext4. And now i am trying to use it as a persistent disk for my elasticsearch Deployment.

I tried lots of ways, not working much. For any data if you need i would be helpful to provide. But kindly get a solution which will work.

I just need help..

-- Bishwajit Samanta
kubernetes
kubernetes-helm

1 Answer

4/12/2019

I don't believe this chart will support local storage.

Looking at the volumeClaimTemplate such as on the master-statefulset.yaml shows that it's missing key parameters for a local volume setup (such as path, nodeAffinity, volumeBindingMode) described here. If you are using a cloud deployment, just use a cloud volume claim. If you have deployed a cluster on a on-prem or just onto your computer, then you should fork the chart and adjust the volume claims to meet the requirements for local storage.

Either way on your future posts you should include relevant logs. With kubernetes errors it's helpful to see from all parts of the stack such as: kubernetes control plane logs, object events (like the output from describing the volume claim), helm logs, elasticsearch pod logs failing to discover a volume, etc etc.

-- Datise
Source: StackOverflow