Recreate is a Kubernetes Deployment update strategy. When the Deployment’s Pod template changes, the controller deletes every old pod, waits for their containers to finish, and then creates the new pods. Service is briefly unavailable while the old pods terminate and before the new ones are ready. Choose Recreate when old and new application versions cannot run together and downtime is acceptable. section 15.2
Listing 15.2 Enabling the Recreate update strategy in a Deployment
...
spec:
strategy: #1
type: Recreate #1
replicas: 3
...
Set `spec.strategy.type` to `Recreate` in the Deployment manifest. Recreate has no additional strategy options; without this setting, a Deployment defaults to RollingUpdate. section 15.2.1 section 15.2
Replace a three-pod application
With Recreate configured, change the Pod template’s container image from `luksa/kiada:0.5` to `luksa/kiada:0.6` and update its `ver` label to match. Run `kubectl get po -l app=kiada -L ver` to watch all three old pods terminate before three version 0.6 pods appear. `kubectl get rs -L ver` then shows the old ReplicaSet at zero replicas and the new one at three. section 15.2.1
Changing only the strategy does not start an update: the Pod template must change. Recreate also governs `kubectl rollout restart`, which deletes and replaces all of the Deployment’s pods rather than replacing them gradually. By contrast, RollingUpdate replaces pods in stages to maintain availability. section 15.2.1 section 15.2.6


