# Installing templates on ES startup

**URL:** <https://discuss.elastic.co/t/installing-templates-on-es-startup/225171>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [March 26, 2020, 11:00am UTC](https://discuss.elastic.co/t/installing-templates-on-es-startup/225171 "2020-03-26T11:00:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TimWardFS](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timwardfs/32/65108_2.png) [@TimWardFS](https://discuss.elastic.co/u/TimWardFS)\
**Post date:** [March 26, 2020, 11:00am UTC](https://discuss.elastic.co/t/installing-templates-on-es-startup/225171/1 "2020-03-26T11:00:59Z")

</div>

When using ECK to run up an Elasticsearch cluster, via a Helm chart, what's the best way to install templates into a new cluster (PUT /\_template/...)?

Possibilities would appear to include:

(1) Put some curl commands in the container's lifecycle/postStart. But they might run before ES is up and running, resulting in the template installations failing?

(2) Use a Helm post-install hook. But then clients of ES might connect and start using ES before the templates have been installed, resulting in wrong indexing?

(3) Something I haven't spotted yet.

What do people do that works?

---

<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 4, 2022, 7:50am UTC](https://discuss.elastic.co/t/installing-templates-on-es-startup/225171/2 "2022-11-04T07:50:51Z")

</div>


