# Elasticsearch docker image and persistence on Kubernetes

**URL:** <https://discuss.elastic.co/t/elasticsearch-docker-image-and-persistence-on-kubernetes/84520>\
**Category:** Elasticsearch\
**Created:** [May 4, 2017, 9:27am UTC](https://discuss.elastic.co/t/elasticsearch-docker-image-and-persistence-on-kubernetes/84520 "2017-05-04T09:27:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kuckkuck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kuckkuck/32/9805_2.png) [@Kuckkuck](https://discuss.elastic.co/u/Kuckkuck)\
**Post date:** [May 4, 2017, 9:27am UTC](https://discuss.elastic.co/t/elasticsearch-docker-image-and-persistence-on-kubernetes/84520/1 "2017-05-04T09:27:38Z")

</div>

Hi,

how to run the offfical elasticsearch docker image with persistence on Kubernetes, if the Docker image is exposing the user elasticsearch, which cannot write to a persistent volume and it cannot be changed via startup script, because the user cannot sudo. Any idea?

Regards,

Olaf

---

<div class="post-metadata">

**Author:** ![Kuckkuck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kuckkuck/32/9805_2.png) [@Kuckkuck](https://discuss.elastic.co/u/Kuckkuck)\
**Post date:** [May 4, 2017, 10:55am UTC](https://discuss.elastic.co/t/elasticsearch-docker-image-and-persistence-on-kubernetes/84520/2 "2017-05-04T10:55:59Z")

</div>

The only solution I found was that one has to use an init container, which is changing the permissions for the volume to the same uid/guids elastisearch is using in the docker image [https://github.com/kubernetes/kubernetes/issues/2630](https://github.com/kubernetes/kubernetes/issues/2630).

Regards,

Olaf

---

<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:** [June 1, 2017, 11:01am UTC](https://discuss.elastic.co/t/elasticsearch-docker-image-and-persistence-on-kubernetes/84520/3 "2017-06-01T11:01:58Z")

</div>

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