Kubernetes · Arazzo Workflow

Kubernetes Restart a Pod by Deleting It

Version 1.0.0

Confirm a pod is controller-owned, delete it gracefully, and watch the replacement appear.

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

Provider

kubernetes

Workflows

restart-pod
Delete a controller-owned pod so its controller recreates it.
Reads the target pod and captures its ownerReferences, deletes it with a graceful termination period, and lists the namespace's matching pods so the freshly scheduled replacement can be observed.
3 steps inputs: gracePeriodSeconds, labelSelector, namespace, podName outputs: deletedPodName, deletionTimestamp, pods, replacementPodName
1
readPod
Read the pod and capture its ownerReferences. A pod with no owner will not be recreated after deletion, so this read is the safety check.
2
deletePod
Delete the pod. The kubelet sends SIGTERM and waits the grace period before forcing termination; the owning controller schedules a replacement.
3
observeReplacement
List the pods matching the same label selector to observe the replacement pod. A new uid distinguishes the replacement from the deleted pod.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Kubernetes Restart a Pod by Deleting It
  summary: Confirm a pod is controller-owned, delete it gracefully, and watch the replacement appear.
  description: >-
    Kubernetes has no restart verb — the idiomatic restart is to delete the pod
    and let its owning controller recreate it. The workflow reads the pod first
    to confirm it carries an ownerReference, because deleting an unowned pod
    destroys it permanently rather than restarting it, then deletes it with an
    explicit grace period and lists the pods to observe the replacement. 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: workloadsApi
  url: ../openapi/kubernetes-workloads-api-openapi.yml
  type: openapi
workflows:
- workflowId: restart-pod
  summary: Delete a controller-owned pod so its controller recreates it.
  description: >-
    Reads the target pod and captures its ownerReferences, deletes it with a
    graceful termination period, and lists the namespace's matching pods so the
    freshly scheduled replacement can be observed.
  inputs:
    type: object
    required:
    - namespace
    - podName
    properties:
      namespace:
        type: string
        description: The namespace containing the pod.
      podName:
        type: string
        description: The name of the pod to restart.
      gracePeriodSeconds:
        type: integer
        description: Seconds to wait before forcefully terminating the pod.
      labelSelector:
        type: string
        description: Label selector matching the pod's siblings (e.g. app=nginx).
  steps:
  - stepId: readPod
    description: >-
      Read the pod and capture its ownerReferences. A pod with no owner will
      not be recreated after deletion, so this read is the safety check.
    operationId: getNamespacedPod
    parameters:
    - name: namespace
      in: path
      value: $inputs.namespace
    - name: name
      in: path
      value: $inputs.podName
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      podName: $response.body#/metadata/name
      podUid: $response.body#/metadata/uid
      ownerReferences: $response.body#/metadata/ownerReferences
      previousPhase: $response.body#/status/phase
      nodeName: $response.body#/spec/nodeName
  - stepId: deletePod
    description: >-
      Delete the pod. The kubelet sends SIGTERM and waits the grace period
      before forcing termination; the owning controller schedules a replacement.
    operationId: deleteNamespacedPod
    parameters:
    - name: namespace
      in: path
      value: $inputs.namespace
    - name: name
      in: path
      value: $steps.readPod.outputs.podName
    - name: gracePeriodSeconds
      in: query
      value: $inputs.gracePeriodSeconds
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      deletionTimestamp: $response.body#/metadata/deletionTimestamp
      deletedPodName: $response.body#/metadata/name
  - stepId: observeReplacement
    description: >-
      List the pods matching the same label selector to observe the replacement
      pod. A new uid distinguishes the replacement from the deleted pod.
    operationId: listNamespacedPods
    parameters:
    - name: namespace
      in: path
      value: $inputs.namespace
    - name: labelSelector
      in: query
      value: $inputs.labelSelector
    - name: limit
      in: query
      value: 100
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      pods: $response.body#/items
      replacementPodName: $response.body#/items/0/metadata/name
      replacementPhase: $response.body#/items/0/status/phase
  outputs:
    deletedPodName: $steps.deletePod.outputs.deletedPodName
    deletionTimestamp: $steps.deletePod.outputs.deletionTimestamp
    replacementPodName: $steps.observeReplacement.outputs.replacementPodName
    pods: $steps.observeReplacement.outputs.pods

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-restart-pod-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.