liveBook · Manning

Rollback

As explained in Machine Learning Platform Engineering

A rollback is the restoration of a deployed application to a previously functioning version.

Rollback restores a deployed application to a previously functioning version when a newer release causes problems. Kubernetes Deployments support rollback alongside gradual rolling updates, limiting user impact during failed upgrades. section 3.3.3

Use rollback as part of a controlled Deployment update:

  • Change the container image tag, such as from v1 to v2, and apply the updated Deployment manifest. section 3.3.3
  • Inspect rollout events and Deployment status to identify scaling activity and whether the intended version is available. section 3.3.3
  • Run kubectl rollout undo deployment/joker-deployment to return to the previous functioning version. section 3.3.3

Rolling back a failed image update

A three-replica Deployment initially runs hello-joker:v1. Updating the manifest to hello-joker:v2 causes Kubernetes to scale ReplicaSets gradually. If the new version misbehaves, kubectl rollout undo deployment/joker-deployment restores the earlier version; Deployment status then reports all three replicas ready, up to date, and available. section 3.3.3

Listing 3.6 deployment.yaml: creating a deployment
apiVersion: apps/v1    #1
kind: Deployment    #2
metadata:
  name: joker-deployment    #3
  labels:
      app: fast-api
spec:
  template:    #4
    metadata:
      name: joker
      labels:
          app: fast-api
    spec:
      containers:
      - name: hello-joker
        image: varunmallya/hello-joker:v1
        ports:
        - containerPort: 8083
  replicas: 3
  selector:
    matchLabels:
      app: fast-api

Inspect the Deployment manifest that defines the replica count, pod template, container image, and selector used by the rollback example. section 3.3.3

How Machine Learning Platform Engineering covers it

How deep it goes
Explains rollback through rolling updates, ReplicaSets, status checks, events, and a kubectl command, without detailing revision internals.
Examples
Uses a hello-joker Deployment, v1-to-v2 image update, rollout events, status output, and kubectl rollout undo.
What it assumes
Assumes familiarity with containers and YAML while introducing pods, ReplicaSets, Deployments, rolling updates, and kubectl operations.
What you can do after
Operate/configure Kubernetes Deployments by applying image updates, inspecting rollout status, and undoing failed releases.
How it connects
Connects Deployments with rolling updates, ReplicaSets, pods, container images, model versioning, and production reliability.

Also explained in

Compare how 8 books explain rollback →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning Platform Engineering. The section links point to the parts of the book it draws on.