A deployment defined with a strategy of type Recreate will terminate all the running instances then recreate them with the newer version.
cd ~/Workshop-K8S/k8s/recreate/
kubectl create ns recreate
kubectl apply -n recreate -f app-v1.yaml
Test:
curl http://[public ip adress load balancer]/api
Or in browser: <http://[public ip adress load balancer]
kubectl apply -n recreate -f app-v2.yaml
Downtime is expected because v1 is killed before v2 is started and healthy:
curl http://[public ip adress load balancer]/api
Or in browser: <http://[public ip adress load balancer]
kubectl delete ns recreate