capabilities.work

Roll Out a New Container Image

A 4-step recipe with Kubernetes. We can help you get access.

Recipe · 4 steps

Roll Out a New Container Image

Update a deployment's container image and observe the resulting rollout.

  1. Read the deployment to confirm it exists and capture its resourceVersion so the replace can be rejected if another writer changed it first.
  2. Replace the deployment with the new image. Changing the pod template spec triggers a rolling update governed by the deployment's update strategy.
  3. Read the deployment back to compare observedGeneration against the new generation and to report updated, ready, and available replica counts.
  4. List namespace events so a rollout that has not converged reports a cause such as an image pull failure or insufficient node capacity.
What you'll need to have ready
  • namespace: The namespace containing the deployment.
  • deploymentName: The name of the deployment to update.
  • appName: The app label value used by the deployment's selector and pod template.
  • image: The new container image to roll out.
  • replicas: Replica count to preserve on the replaced deployment.
  • containerPort: Container port to preserve on the replaced pod template.
For your developer

Arazzo workflow kubernetes:rolling-update-deployment, 4 operations: getNamespacedDeployment → replaceNamespacedDeployment → getNamespacedDeployment → listNamespacedEvents. Specs on APIs.io.