Skip to content
Proud to collaborate with Microsoft for Startups

kubernetes.deployment.rollback ​

Roll a Deployment back to a previous revision (kubectl rollout undo equivalent)

Rolls a Deployment back to a previous revision by selecting the matching ReplicaSet and strategic-merge-patching the Deployment's pod-template spec.

This is the modern equivalent of kubectl rollout undo — it does NOT use the deprecated /rollback sub-resource removed in Kubernetes 1.16.

Inputs:

  • connection_uuid: Cloud connection UUID (required)
  • namespace: Target namespace (required)
  • name: Deployment name (required)
  • revision: Specific revision number to roll back to (optional). When omitted the highest revision that is NOT the current one is selected (i.e., the previous revision).

Outputs:

  • connection_uuid, namespace, name (echoed through)
  • rolled_back_to_revision: Revision number that was restored
  • previous_revision: Revision that was active before the rollback
  • generation: New Deployment generation reported by the API server

Plugin required: context.get_plugin("connection").kubernetes_runner_clients(connection_uuid, organization_uuid) must expose apps_v1 (read_namespaced_deployment, list_namespaced_replica_set, patch_namespaced_deployment) and api_client (sanitize_for_serialization).

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-kubernetes
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidYes——
namespacestringYes——
namestringYes——
revisionintegerNo——
organization_uuiduuidNo——

Output Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidNo——
organization_uuiduuidNo——
namespacestringNo——
namestringNo——
revisionintegerNo——
rolled_back_to_revisionintegerNo——
previous_revisionintegerNo——
generationintegerNo——
failure_reasonstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_stepstringNo——
failed_layerstringNo——
errorstringNo——
error_typestringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—execute—
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompleted—
* (any state)failfailed—

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "kubernetes.deployment.rollback",
  "initial_data": {
    "connection_uuid": "value",
    "namespace": "value",
    "name": "value"
  }
}