# Index template lost after recreate es cluster in Kubernetes environment

**URL:** https://discuss.elastic.co/t/index-template-lost-after-recreate-es-cluster-in-kubernetes-environment/83791
**Category:** Elasticsearch
**Created:** [April 27, 2017, 4:28am UTC](https://discuss.elastic.co/t/index-template-lost-after-recreate-es-cluster-in-kubernetes-environment/83791 "2017-04-27T04:28:05Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Yong\_Zhang](https://avatars.discourse-cdn.com/v4/letter/y/a183cd/32.png) [@Yong\_Zhang](https://discuss.elastic.co/u/Yong_Zhang)
#### Post date: [April 27, 2017, 4:28am UTC](https://discuss.elastic.co/t/index-template-lost-after-recreate-es-cluster-in-kubernetes-environment/83791/1 "2017-04-27T04:28:05Z")

</div>

Hi, All

I'm using Kubernetes to deploy es cluster and I'm really stuck at stability. (Referenced [https://github.com/pires/kubernetes-elasticsearch-cluster](https://github.com/pires/kubernetes-elasticsearch-cluster))  
I have 3 master node and 2 client node deployed as stateless pods (without data persists), and 3 data nodes deployed as statefulset (data persists).

When I first started the cluster, everything is fine. But after delete the whole cluster and start again, all index patterns are lost and all custom templates are gone, I have to re-add them back. So anyone can tell me anything else should I to in Kubernetes to avoid data lose? Thanks a lot.

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [April 27, 2017, 4:39am UTC](https://discuss.elastic.co/t/index-template-lost-after-recreate-es-cluster-in-kubernetes-environment/83791/2 "2017-04-27T04:39:53Z")

</div>

Dedicated master nodes do not store data, but still need persistent storage for the cluster state, so I believe you should make them stateful as well.

---

<div class="post-metadata">

### Author: ![Yong\_Zhang](https://avatars.discourse-cdn.com/v4/letter/y/a183cd/32.png) [@Yong\_Zhang](https://discuss.elastic.co/u/Yong_Zhang)
#### Post date: [April 27, 2017, 4:44am UTC](https://discuss.elastic.co/t/index-template-lost-after-recreate-es-cluster-in-kubernetes-environment/83791/3 "2017-04-27T04:44:26Z")

</div>

I will try, and how nodes are managed by elasticsearch? I mean, re-creating pods is something like creating new machines, all of the nodes are not the old ones anymore, so uuid may be changed, will this impact something?

---

<div class="post-metadata">

### Author: ![Yong\_Zhang](https://avatars.discourse-cdn.com/v4/letter/y/a183cd/32.png) [@Yong\_Zhang](https://discuss.elastic.co/u/Yong_Zhang)
#### Post date: [April 28, 2017, 2:19am UTC](https://discuss.elastic.co/t/index-template-lost-after-recreate-es-cluster-in-kubernetes-environment/83791/4 "2017-04-28T02:19:35Z")

</div>

I combined data node and master node, now everything looks fine. Any performance concerns for doing this?

---

<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 26, 2017, 2:29am UTC](https://discuss.elastic.co/t/index-template-lost-after-recreate-es-cluster-in-kubernetes-environment/83791/5 "2017-05-26T02:29:31Z")

</div>

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