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

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?

1 Like

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.

2 Likes

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.

2 Likes

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

That's what I meant by "rolling upgrade" :slight_smile:

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.

2 Likes

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