Patterns and configurations required to handle in-flight workflows during rolling updates of docker container images

Hi,

Our server application is written in Java and uses Dropwizard as a base framework to bootstrap the server. The server application’s code has the workflows and activities definitions for various business process workflows needed by our application.

The server application will be packaged as a Docker container and the container’s lifecycle will be managed by a container orchestration tool such as Docker Swarm or Kubernetes. I understand that there will be some impact to the in-flight workflows during the deployments of the new version of the server, when Docker Swarm or Kubernetes performs rolling updates of the docker container images.

I would like to understand what code pattern need to be followed in the server’s Java code to ensure that the in-flight workflows will reach a safe state when the old containers are shut down and will resume correctly in the new containers during deployments.

I believe the scenario I described may be a recurring one across many applications and the solution to this may have been already documented in Temporal.io’s API docs or in a community discussion thread. Any reference to a documented solution would be very helpful too!