# Database dump with Helm charts

**URL:** <https://discuss.elastic.co/t/database-dump-with-helm-charts/203569>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [October 15, 2019, 6:52am UTC](https://discuss.elastic.co/t/database-dump-with-helm-charts/203569 "2019-10-15T06:52:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kvin](https://avatars.discourse-cdn.com/v4/letter/k/e99b99/32.png) [@Kvin](https://discuss.elastic.co/u/Kvin)\
**Post date:** [October 15, 2019, 6:52am UTC](https://discuss.elastic.co/t/database-dump-with-helm-charts/203569/1 "2019-10-15T06:52:44Z")

</div>

I'm trying to set up an Elasticsearch environment with Kubernetes-Helm-Docker etc. I'm going to enable xpack later on. I want the setup of this environment as automatic as possible.

I would like to have some basic data to be PUT into ES upon deploying an environment like this into a new cluster. Data like index patterns in the .kibana index, default users, some visualizations and so on. So not the -actual- log data or any other business information. I just want to have Kibana ready with all the index patterns after launching this environment without me having to set them up manually.

How can I achieve to have a basic database dump which is put into ES upon every new deployment?

So far the only option I see is setting up CURLs in the `data.hooks.preStart` part, but I'm not really fond of that because with XPack enabled I would have to store user passwords in plain text.

Any ideas?

---

<div class="post-metadata">

**Author:** ![michael.russell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael.russell/32/27889_2.png) [@michael.russell](https://discuss.elastic.co/u/michael.russell)\
**Post date:** [October 16, 2019, 8:41am UTC](https://discuss.elastic.co/t/database-dump-with-helm-charts/203569/2 "2019-10-16T08:41:43Z")

</div>

Instead of putting the passwords in plain text you can just reference the environment variables (set via Kubernetes secrets). The Elasticsearch chart does something similar with the readinessProbe used for health checks:

> <https://github.com/elastic/helm-charts/blob/340868c54c44ae97fd9ef8fa6d682472098dc816/elasticsearch/templates/statefulset.yaml#L192-L223>

And an example of setting the username and password via environment variables:

> <https://github.com/elastic/helm-charts/blob/340868c54c44ae97fd9ef8fa6d682472098dc816/elasticsearch/examples/security/security.yml#L23-L33>

---

<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:** [November 13, 2019, 8:41am UTC](https://discuss.elastic.co/t/database-dump-with-helm-charts/203569/3 "2019-11-13T08:41:46Z")

</div>

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