When upgrading pods using the recreate strategy, existing pods are terminated before new ones are created.
To use the recreate strategy, define the Deployment yaml as such:
apiVersion: apps/v1 kind: Deployment spec: replicas: 2 strategy: type: Recreate
The Deployment as defined above will create two replica pods:
The recreate strategy will terminate both replicas. During this time, the service is down and will not be able to handle traffic:
The upgraded replicas will then move into the Pending and ContainerCreating. During this time, the service is unable to handle traffic:
Once the upgraded replicas have come up successfully, the pods are ready to handle traffic.