Version A is terminated then version B is rolled out.
The recreate strategy is a dummy deployment which consists of shutting down version A then deploying version B after version A is turned off. This technique implies downtime of the service that depends on both shutdown and boot duration of the application.
- version 1 is service traffic
- delete version 1
- deploy version 2
- wait until all replicas are ready
# Deploy the first application
$ kubectl apply -f kuber-deployment-v1.yaml
# Test if the deployment was successful
$ curl $(minikube service kuber-service --url)
# To see the deployment in action, open a new terminal and run the following command
$ watch kubectl get po --watch
# Then deploy version 2 of the application
$ kubectl apply -f kuber-deployment-v2.yaml
# Test the second deployment progress
service=$(minikube service kuber-service --url)
while true; do curl "$service"; sleep 2; echo; done
# Cleanup
$ kubectl delete all -l app=kuber