Chapter 17. Application Lifecycle Management

When your application is being deployed, scaled up, redeployed, or shut down, it is done following a set of prescribed steps. As you saw in the previous chapter, health probes can be used to determine whether the application successfully starts, is ready to accept requests, and continues to run correctly. These are, though, just part of a larger process dictated by the deployment strategy being used.

OpenShift implements two basic deployment strategies. The default deployment strategy is a Rolling deployment. The aim of this deployment strategy is to enable zero-downtime deployments when rolling out an update to an application.

The second deployment strategy is Recreate. This is used when you cannot have multiple instances, or versions, of your application running at the same time. It is also necessary to use this deployment strategy when persistent storage is used that can only be bound to a single node in a cluster at a time.

In this chapter you will learn more about these deployment strategies as well as how to define lifecycle hooks, special commands that are executed at set points within a deployment.

You will also learn about hooks that can be associated with the startup and shutdown of individual pods.

Deployment Strategies

A deployment strategy defines the process by which a new version of your application is started and the existing instances shut down.

To view what strategy a deployment is using, run the oc describe command ...

Get Deploying to OpenShift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.