# How to prevent kubernetes bring down more than 1 data node during the deployment

**URL:** <https://discuss.elastic.co/t/how-to-prevent-kubernetes-bring-down-more-than-1-data-node-during-the-deployment/279104>\
**Category:** Elasticsearch\
**Created:** [July 19, 2021, 7:05pm UTC](https://discuss.elastic.co/t/how-to-prevent-kubernetes-bring-down-more-than-1-data-node-during-the-deployment/279104 "2021-07-19T19:05:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![junhuangli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/junhuangli/32/77615_2.png) [@junhuangli](https://discuss.elastic.co/u/junhuangli)\
**Post date:** [July 19, 2021, 7:05pm UTC](https://discuss.elastic.co/t/how-to-prevent-kubernetes-bring-down-more-than-1-data-node-during-the-deployment/279104/1 "2021-07-19T19:05:31Z")

</div>

Not sure if this is a question for kubernetes or for elasticsearch.

We are hosting elasticsearch on kubernetes. And during the deployment, the kubernetes brings down the pods 1 by 1. But it doesn't wait for the data node to join the cluster before bringing down the next one. Similar issue for master node. Is there any way to prevent that?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 25, 2021, 11:27pm UTC](https://discuss.elastic.co/t/how-to-prevent-kubernetes-bring-down-more-than-1-data-node-during-the-deployment/279104/2 "2021-07-25T23:27:54Z")

</div>

Are you using ECK?

---

<div class="post-metadata">

**Author:** ![junhuangli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/junhuangli/32/77615_2.png) [@junhuangli](https://discuss.elastic.co/u/junhuangli)\
**Post date:** [July 26, 2021, 12:38am UTC](https://discuss.elastic.co/t/how-to-prevent-kubernetes-bring-down-more-than-1-data-node-during-the-deployment/279104/3 "2021-07-26T00:38:20Z")

</div>

No, we are hosting/maintaining elasticsearch cluster ourselves on the kubernetes.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 26, 2021, 12:41am UTC](https://discuss.elastic.co/t/how-to-prevent-kubernetes-bring-down-more-than-1-data-node-during-the-deployment/279104/4 "2021-07-26T00:41:56Z")

</div>

Ok.

Well that's definitely something that k8's would need to handle, but I am not sure on how you'd do that sorry.

---

<div class="post-metadata">

**Author:** ![legoguy1000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/legoguy1000/32/54301_2.png) [@legoguy1000](https://discuss.elastic.co/u/legoguy1000)\
**Post date:** [July 26, 2021, 1:29am UTC](https://discuss.elastic.co/t/how-to-prevent-kubernetes-bring-down-more-than-1-data-node-during-the-deployment/279104/5 "2021-07-26T01:29:38Z")

</div>

The reason is k8s doesn't know what "join the cluster" means. All it knows is that the pods is running and that's the signal to bring down the next pod

---

<div class="post-metadata">

**Author:** ![junhuangli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/junhuangli/32/77615_2.png) [@junhuangli](https://discuss.elastic.co/u/junhuangli)\
**Post date:** [July 26, 2021, 1:45am UTC](https://discuss.elastic.co/t/how-to-prevent-kubernetes-bring-down-more-than-1-data-node-during-the-deployment/279104/6 "2021-07-26T01:45:34Z")

</div>

Yes, that is right. Will adding the check to " readiness/startup probes" helps here? Or maybe add a "poststart lifecycle"?

Any suggestion is highly appreciated

---

<div class="post-metadata">

**Author:** ![legoguy1000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/legoguy1000/32/54301_2.png) [@legoguy1000](https://discuss.elastic.co/u/legoguy1000)\
**Post date:** [July 26, 2021, 2:01am UTC](https://discuss.elastic.co/t/how-to-prevent-kubernetes-bring-down-more-than-1-data-node-during-the-deployment/279104/7 "2021-07-26T02:01:58Z")

</div>

Idk what the best answer is besides using ECK which handles it all for you.

---

<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:** [August 23, 2021, 2:02am UTC](https://discuss.elastic.co/t/how-to-prevent-kubernetes-bring-down-more-than-1-data-node-during-the-deployment/279104/8 "2021-08-23T02:02:48Z")

</div>

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