I'm setting up an Elasticsearch cluster using Kubernetes on 4 nodes. Each node has a mounted drive that I want to use for Elasticsearch storage instead of the host volume. I know that in each container that runs Elasticsearch there is an data directory where the indices are stored. What I want to do is to make the underlying storage of this data directory in the container map to the drive that I have mounted. So basically I want to solve the following problems
Can I use hostPath type mounts with Elasticsearch? In that case I will configure Elasticsearch Pods to use my drive as the storage for the path.data
How do PVCs work in Elasticsearch? Can I use those to to achieve similar behaviour as I want?
I hope it can help you (maybe too late)
Yes and Yes
First Yes : Yes you can use a hostPath but It is not necessarily a sustainable solution to use a HostPath.
Second Yes : I recommend you to use StorageClass to deal this problem
For the first Yes, you can try something like this (it's in yaml) :
Exemple with 1 node Elasticsearch cluster
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.