Kubernetes · Arazzo Workflow

Kubernetes Roll Out a New Container Image

Version 1.0.0

Read a deployment, replace it with an updated image, then watch the rollout and its events.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub AutomationCloud-NativeCNCFContainersDeploymentOpen-SourceOrchestrationScalingArazzoWorkflows

Provider

kubernetes

Workflows

rolling-update-deployment
Update a deployment's container image and observe the resulting rollout.
Fetches the deployment, replaces it with an updated pod template that carries the new image, re-reads the deployment for rollout progress, and lists namespace events to explain a rollout that has not converged.
4 steps inputs: appName, containerPort, deploymentName, image, namespace, replicas outputs: events, observedGeneration, readyReplicas, updatedGeneration
1
readDeployment
Read the deployment to confirm it exists and capture its resourceVersion so the replace can be rejected if another writer changed it first.
2
applyNewImage
Replace the deployment with the new image. Changing the pod template spec triggers a rolling update governed by the deployment's update strategy.
3
observeRollout
Read the deployment back to compare observedGeneration against the new generation and to report updated, ready, and available replica counts.
4
readRolloutEvents
List namespace events so a rollout that has not converged reports a cause such as an image pull failure or insufficient node capacity.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Kubernetes Roll Out a New Container Image
  summary: Read a deployment, replace it with an updated image, then watch the rollout and its events.
  description: >-
    A rolling image update is the most frequent write an integrator makes
    against a cluster. The workflow reads the current deployment to capture its
    resourceVersion for optimistic concurrency, replaces it with the same spec
    carrying the new image, reads it back to observe the rollout, and pulls the
    namespace's events so a stalled rollout surfaces a reason rather than a
    silent hang. Every step spells out its request inline so the flow can be
    read and executed without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: eventsApi
  url: ../openapi/kubernetes-events-api-openapi.yml
  type: openapi
- name: workloadsApi
  url: ../openapi/kubernetes-workloads-api-openapi.yml
  type: openapi
workflows:
- workflowId: rolling-update-deployment
  summary: Update a deployment's container image and observe the resulting rollout.
  description: >-
    Fetches the deployment, replaces it with an updated pod template that
    carries the new image, re-reads the deployment for rollout progress, and
    lists namespace events to explain a rollout that has not converged.
  inputs:
    type: object
    required:
    - namespace
    - deploymentName
    - appName
    - image
    - replicas
    - containerPort
    properties:
      namespace:
        type: string
        description: The namespace containing the deployment.
      deploymentName:
        type: string
        description: The name of the deployment to update.
      appName:
        type: string
        description: The app label value used by the deployment's selector and pod template.
      image:
        type: string
        description: The new container image to roll out.
      replicas:
        type: integer
        description: Replica count to preserve on the replaced deployment.
      containerPort:
        type: integer
        description: Container port to preserve on the replaced pod template.
  steps:
  - stepId: readDeployment
    description: >-
      Read the deployment to confirm it exists and capture its resourceVersion
      so the replace can be rejected if another writer changed it first.
    operationId: getNamespacedDeployment
    parameters:
    - name: namespace
      in: path
      value: $inputs.namespace
    - name: name
      in: path
      value: $inputs.deploymentName
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      deploymentName: $response.body#/metadata/name
      resourceVersion: $response.body#/metadata/resourceVersion
      generation: $response.body#/metadata/generation
      previousReadyReplicas: $response.body#/status/readyReplicas
  - stepId: applyNewImage
    description: >-
      Replace the deployment with the new image. Changing the pod template spec
      triggers a rolling update governed by the deployment's update strategy.
    operationId: replaceNamespacedDeployment
    parameters:
    - name: namespace
      in: path
      value: $inputs.namespace
    - name: name
      in: path
      value: $steps.readDeployment.outputs.deploymentName
    requestBody:
      contentType: application/json
      payload:
        apiVersion: apps/v1
        kind: Deployment
        metadata:
          name: $inputs.deploymentName
          namespace: $inputs.namespace
          resourceVersion: $steps.readDeployment.outputs.resourceVersion
          labels:
            app: $inputs.appName
        spec:
          replicas: $inputs.replicas
          selector:
            matchLabels:
              app: $inputs.appName
          strategy:
            type: RollingUpdate
            rollingUpdate:
              maxUnavailable: 0
              maxSurge: 1
          minReadySeconds: 10
          revisionHistoryLimit: 10
          template:
            metadata:
              labels:
                app: $inputs.appName
            spec:
              containers:
              - name: $inputs.appName
                image: $inputs.image
                imagePullPolicy: IfNotPresent
                ports:
                - name: http
                  containerPort: $inputs.containerPort
                  protocol: TCP
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      updatedGeneration: $response.body#/metadata/generation
      updatedResourceVersion: $response.body#/metadata/resourceVersion
  - stepId: observeRollout
    description: >-
      Read the deployment back to compare observedGeneration against the new
      generation and to report updated, ready, and available replica counts.
    operationId: getNamespacedDeployment
    parameters:
    - name: namespace
      in: path
      value: $inputs.namespace
    - name: name
      in: path
      value: $steps.readDeployment.outputs.deploymentName
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      observedGeneration: $response.body#/status/observedGeneration
      updatedReplicas: $response.body#/status/updatedReplicas
      readyReplicas: $response.body#/status/readyReplicas
      availableReplicas: $response.body#/status/availableReplicas
  - stepId: readRolloutEvents
    description: >-
      List namespace events so a rollout that has not converged reports a cause
      such as an image pull failure or insufficient node capacity.
    operationId: listNamespacedEvents
    parameters:
    - name: namespace
      in: path
      value: $inputs.namespace
    - name: limit
      in: query
      value: 100
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      events: $response.body#/items
  outputs:
    updatedGeneration: $steps.applyNewImage.outputs.updatedGeneration
    observedGeneration: $steps.observeRollout.outputs.observedGeneration
    readyReplicas: $steps.observeRollout.outputs.readyReplicas
    events: $steps.readRolloutEvents.outputs.events

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/kubernetes-rolling-update-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.