liveBook · Manning

Rolling update

As explained in Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform

A rolling update is a deployment technique that incrementally replaces running application instances with a new version while keeping other instances available.

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

How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it

How deep it goes
Explains the replica sequence, readiness gating, halt behavior, and possible rollback, while deferring detailed Kubernetes documentation.
Examples
Uses a three-replica gateway deployment configured with RollingUpdate, maxSurge 1, and maxUnavailable 0.
What it assumes
Assumes Kubernetes deployments, replicas, and readiness probes are available concepts.
What you can do after
Operate Kubernetes deployments that validate each replacement and halt or roll back when a new instance fails readiness.
How it connects
Connects microservices with Kubernetes deployments, replicas, readiness probes, debugging, rollback, and blue-green deployments.

Also explained in

Compare how 8 books explain rolling update →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform. The section links point to the parts of the book it draws on.