# Recreate a cluster with the same cluster\_uuid in k8s stetefullset configuration

**URL:** https://discuss.elastic.co/t/recreate-a-cluster-with-the-same-cluster-uuid-in-k8s-stetefullset-configuration/184731
**Category:** Elasticsearch
**Created:** [June 7, 2019, 9:45am UTC](https://discuss.elastic.co/t/recreate-a-cluster-with-the-same-cluster-uuid-in-k8s-stetefullset-configuration/184731 "2019-06-07T09:45:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![nilubkal](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@nilubkal](https://discuss.elastic.co/u/nilubkal)
#### Post date: [June 7, 2019, 9:45am UTC](https://discuss.elastic.co/t/recreate-a-cluster-with-the-same-cluster-uuid-in-k8s-stetefullset-configuration/184731/1 "2019-06-07T09:45:31Z")

</div>

Hello , i'm able to upgrade eleasticsearch from v 6.6.0 to 7.1.1 using the officially provided docker in a stetefull set in kubernetes without a problem. After applying the cluster.initial\_master\_nodes with a list of 3 hosts the master is elected and everything works fine. After i redeploy the same version the pods are recreated and they complain about being part of the previous cluster ( referencing the old cluster\_uuid ) and that they cannot form a new cluster .  
The setup is: 3 pods / nodes acting as masters + 2 data nodes  
My questions are the following :

1. I would like to avoid storing the /data folder from the master nodes ( pods ) on a persistent volume, so is it possible to inject the same cluster\_uuid into the configuration when recreating the masters , or maybe i'll need to pass more metadata ?

2. Since version 7 i can see that there are a lot of changes in cluster formation. Can you share what are the best practices in using the kubernetes environment and keeping stuff agile and stable at the same time ?

Thank you !

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [June 7, 2019, 10:27am UTC](https://discuss.elastic.co/t/recreate-a-cluster-with-the-same-cluster-uuid-in-k8s-stetefullset-configuration/184731/2 "2019-06-07T10:27:39Z")

</div>

> [@nilubkal](#):
>
> I would like to avoid storing the /data folder from the master nodes ( pods ) on a persistent volume,

It is essential that the master nodes have persistent storage. From [the docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html#master-node):

> Master nodes must have access to the `data/` directory (just like `data` nodes) as this is where the cluster state is persisted between node restarts.

---

<div class="post-metadata">

### Author: ![nilubkal](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@nilubkal](https://discuss.elastic.co/u/nilubkal)
#### Post date: [June 7, 2019, 2:27pm UTC](https://discuss.elastic.co/t/recreate-a-cluster-with-the-same-cluster-uuid-in-k8s-stetefullset-configuration/184731/3 "2019-06-07T14:27:23Z")

</div>

Thanks David for your quick reply, i'll change the config and try to keep the data folder.

---

<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: [July 5, 2019, 2:27pm UTC](https://discuss.elastic.co/t/recreate-a-cluster-with-the-same-cluster-uuid-in-k8s-stetefullset-configuration/184731/4 "2019-07-05T14:27:24Z")

</div>

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