Setting path.repo for kubernetes pods

I understand you have to set the path.repo in elasticsearch.yml to create a backup like this:
path.repo: /mnt/backup

But I have elasticsearch running on Kubernetes, and I would like to set the path.repo from a statefulset or something similar to all pods at the same time.
Can anyone tell me how to do that?
Thanks

I tried to do this with configmap like this:

but when I restarted the pod it threw an error:
/usr/share/elasticsearch/bin/run.sh: line 28: ./config/elasticsearch.yml: Read-only file system

I just realized, that you don't even have to edit elasticsearch.yml to set the path.repo setting, you can add it as an enviromental variable in your statefulset like this:
env:

  • name: path.repo
    value: "/mnt/backup"

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