A rolling update replaces running application instances with a new version incrementally, keeping other instances available while each replacement is validated. section 12.4.4
A Kubernetes rolling update provides a controlled rollout:
- Replace one replica with the new version. section 12.4.4
- Wait for the new instance to pass its readiness probe before replacing the next replica. section 12.4.4
- If a new instance fails to become ready, halt the deployment, debug the problem, and possibly roll back. section 12.4.4
Listing 12.10 Enabling rolling updates for the gateway microservice
apiVersion: apps/v1
kind: Deployment
metadata:
name: gateway
spec:
replicas: 3 #1
selector:
matchLabels:
app: gateway
strategy:
type: RollingUpdate #2
rollingUpdate:
maxSurge: 1 #3
maxUnavailable: 0 #4
template:
--snip--
The deployment configuration enables RollingUpdate for three gateway replicas, permits one extra replica, and allows no unavailable replicas during replacement. section 12.4.4
Gateway rollout
With three gateway replicas, Kubernetes replaces the first replica and checks it, then proceeds through the second and third. A failure after the first replacement can be undone without adversely affecting customers. section 12.4.4







