# 'Lock' in Persistent Volumes on Openshift when deploys blue-green ELK Stack

**URL:** <https://discuss.elastic.co/t/lock-in-persistent-volumes-on-openshift-when-deploys-blue-green-elk-stack/262377>\
**Category:** Elasticsearch\
**Created:** [January 27, 2021, 2:29pm UTC](https://discuss.elastic.co/t/lock-in-persistent-volumes-on-openshift-when-deploys-blue-green-elk-stack/262377 "2021-01-27T14:29:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonhmb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonhmb/32/82993_2.png) [@jonhmb](https://discuss.elastic.co/u/jonhmb)\
**Post date:** [January 27, 2021, 2:29pm UTC](https://discuss.elastic.co/t/lock-in-persistent-volumes-on-openshift-when-deploys-blue-green-elk-stack/262377/1 "2021-01-27T14:29:50Z")

</div>

I have an ELK Stack running in a Openshift POD as 'Blue' using Persistent Volumes to storage data.

When I try to deploy a second ELK Stack in a second POD using the same Persistent Volumes, i get an error because ELK Volumes has a lock.

How can I do a blue-green deployment using the same data from the current ELK Stack?

---

<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:** [January 27, 2021, 4:01pm UTC](https://discuss.elastic.co/t/lock-in-persistent-volumes-on-openshift-when-deploys-blue-green-elk-stack/262377/2 "2021-01-27T16:01:34Z")

</div>

Blue/green deployments work well for the stateless parts of systems, but stateful bits like Elasticsearch don't fit into a blue/green model very well at all. You can probably cobble something together with snapshot/restore if you really want, but most folks do rolling upgrades instead.

---

<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:** [January 28, 2021, 1:02am UTC](https://discuss.elastic.co/t/lock-in-persistent-volumes-on-openshift-when-deploys-blue-green-elk-stack/262377/3 "2021-01-28T01:02:41Z")

</div>

The other option is to create a new pod with the updated Elasticsearch image, shutdown the old pod and detach the volume from it, then attach the volume to the new pod and start it.

---

<div class="post-metadata">

**Author:** ![jonhmb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonhmb/32/82993_2.png) [@jonhmb](https://discuss.elastic.co/u/jonhmb)\
**Post date:** [January 28, 2021, 11:19am UTC](https://discuss.elastic.co/t/lock-in-persistent-volumes-on-openshift-when-deploys-blue-green-elk-stack/262377/4 "2021-01-28T11:19:26Z")

</div>

Yes we did it but the intention here was to run the second application without stopping the first, then (when everything is ok with the second) we stop the first and nobody would run out of access

---

<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:** [January 28, 2021, 1:17pm UTC](https://discuss.elastic.co/t/lock-in-persistent-volumes-on-openshift-when-deploys-blue-green-elk-stack/262377/5 "2021-01-28T13:17:57Z")

</div>

> [@warkolm](#):
>
> The other option is to create a new pod with the updated Elasticsearch image, shutdown the old pod and detach the volume from it, then attach the volume to the new pod and start it.

That's what I meant by "rolling upgrade" 🙂

> [@jonhmb](#):
>
> Yes we did it but the intention here was to run the second application without stopping the first, then (when everything is ok with the second) we stop the first and nobody would run out of access

Yeah you can upgrade your application that way, but it's simplest to have both versions of the app pointing at the same Elasticsearch cluster. If you don't want that, you can make a new cluster and restore a snapshot of your old cluster into it. The trouble with that is that any data changes made after the snapshot was taken won't be visible to the new application, but that's just a general problem with blue/green deployments of stateful systems.

---

<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:** [February 25, 2021, 1:18pm UTC](https://discuss.elastic.co/t/lock-in-persistent-volumes-on-openshift-when-deploys-blue-green-elk-stack/262377/6 "2021-02-25T13:18:00Z")

</div>

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