# Setting path.repo for kubernetes pods

**URL:** <https://discuss.elastic.co/t/setting-path-repo-for-kubernetes-pods/178186>\
**Category:** Elasticsearch\
**Created:** [April 24, 2019, 8:30am UTC](https://discuss.elastic.co/t/setting-path-repo-for-kubernetes-pods/178186 "2019-04-24T08:30:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fbede4](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@fbede4](https://discuss.elastic.co/u/fbede4)\
**Post date:** [April 24, 2019, 8:30am UTC](https://discuss.elastic.co/t/setting-path-repo-for-kubernetes-pods/178186/1 "2019-04-24T08:30:58Z")

</div>

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:

> [@Modify elastic.yml file in kubernetes pod](https://discuss.elastic.co/t/modify-elastic-yml-file-in-kubernetes-pod/103612):
>
> Hello! I have an elasticsearch cluster running on minikube. When I ssh into one of the elasticsearch pods, I can see that the elasticsearch.yml file is very empty/has almost no configs set. [elasticsearch@es-0 config]$ cat elasticsearch.yml cluster.name: "docker-cluster" network.host: 0.0.0.0 # minimum\_master\_nodes need to be explicitly set when bound on a public IP # set to 1 to allow single node clusters # Details: https://github.com/elastic/elasticsearch/pull/17288 discovery.zen.minimum\_ma…

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`

---

<div class="post-metadata">

**Author:** ![fbede4](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@fbede4](https://discuss.elastic.co/u/fbede4)\
**Post date:** [April 29, 2019, 8:14am UTC](https://discuss.elastic.co/t/setting-path-repo-for-kubernetes-pods/178186/2 "2019-04-29T08:14:56Z")

</div>

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"

---

<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:** [May 27, 2019, 8:14am UTC](https://discuss.elastic.co/t/setting-path-repo-for-kubernetes-pods/178186/3 "2019-05-27T08:14:58Z")

</div>

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