A rollout strategy controls how a Deployment replaces old pods after an application version changes. Kubernetes creates a new ReplicaSet and manages the transition between versions. section 5.1.2
Choose the strategy according to availability and version-compatibility requirements:
- RollingUpdate keeps old pods until new ReplicaSet pods are ready, reducing downtime and preventing active connections from being severed. section 5.1.2
- Recreate terminates old pods before starting new ones, causing downtime but supporting applications that cannot run multiple versions simultaneously. section 5.1.2
- Inspect or change the strategy in the Deployment specification with kubectl edit deploy apache; RollingUpdate is the default. section 5.1.2
Observe an image rollout
Change the Deployment image, then run kubectl get po -w immediately. Watch the old ReplicaSet pods terminate only after the new ReplicaSet pods become ready. section 5.1.2
Figure 5.8 The rollout strategy is set to RollingUpdate with a max surge of 25% and a max unavailable of 25%.
Use the manifest view to inspect RollingUpdate settings such as maxSurge and maxUnavailable. section 5.1.2
