Dagweave catalog

Restart a workload

kubectl-rollout-restartv1.0.0updated 2026-10-181 version

Restart a Deployment, StatefulSet or DaemonSet so its pods are replaced one at a time, and optionally wait until the new pods are ready.

Install v1.0.0

Installs the template into your Argo namespace. The URL is pinned to this version.

kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/kubectl-rollout-restart/1.0.0/template.yaml

Or with the Argo CLI:

argo template create -n argo https://catalog.dagweave.com/api/v1/items/kubectl-rollout-restart/1.0.0/template.yaml

Facts

Category
Kubernetes
Tags
kubectl kubernetes
Entrypoint
restart
Template SHA-256
5c1b00dea8c2898f3f9b732a3c314326ed3f6302f6e4454de8e673221590e100
Source
kubectl-rollout-restart at catalog commit 67458f7
API
item document, latest template.yaml

Images and provenance

Every image is pinned by digest, so a rebuilt tag can never change what this version runs.

RepositoryTagDigest
cgr.dev/chainguard/kubectllatest-devsha256:98f9c337808ecf5d5e80b79af4345762a3d8c803ebf8c857d2dddabf885107ba

Parameters

NameDescriptionDefault
name required Name of the workload.
Example checkout-api
none
kind Kind of workload to restart.
One of deployment, statefulset, daemonset
deployment
namespace Namespace the resource lives in.
Example default
default
timeout Longest time to wait for the rollout, such as 300s or 5m. 300s
wait Set to "true" to block until the new pods are ready.
One of true, false
true

WorkflowTemplate

Download template.yaml

apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  name: kubectl-rollout-restart
  labels:
    dagweave.io/catalog-item: kubectl-rollout-restart
  annotations:
    dagweave.io/catalog-version: "1.0.0"
    dagweave.io/catalog-category: "Kubernetes"
spec:
  entrypoint: restart
  templates:
    - name: restart
      metadata:
        annotations:
          dagweave.io/local-support: unsupported
          dagweave.io/local-support-reason: >-
            This step runs kubectl with whatever identity the pod is given. On Dagweave
            Local that is the default service account of the hidden cluster's argo
            namespace, which Argo's quick-start install grants create, get and patch on pods
            and create and get on workflows, and nothing anywhere else. The restart patches
            a workload in the apps group, which that account cannot touch, so the step fails
            on a 403 rather than touching anything. The cluster you meant is one this run
            cannot reach.
      inputs:
        parameters:
          - name: kind
            default: "deployment"
          - name: name
          - name: namespace
            default: "default"
          - name: wait
            default: "true"
          - name: timeout
            default: "300s"
      retryStrategy:
        limit: "2"
        retryPolicy: OnError
        backoff:
          duration: 10s
          factor: "2"
          maxDuration: 2m
      container:
        # cgr.dev/chainguard/kubectl:latest-dev
        image: cgr.dev/chainguard/kubectl@sha256:98f9c337808ecf5d5e80b79af4345762a3d8c803ebf8c857d2dddabf885107ba
        command: [sh, -c]
        args:
          - |
            set -eu
            kubectl rollout restart "${KIND}/${NAME}" -n "${NAMESPACE}"
            if [ "${WAIT}" = "true" ]; then
              kubectl rollout status "${KIND}/${NAME}" -n "${NAMESPACE}" --timeout="${TIMEOUT}"
            fi
        env:
          - name: KIND
            value: "{{inputs.parameters.kind}}"
          - name: NAME
            value: "{{inputs.parameters.name}}"
          - name: NAMESPACE
            value: "{{inputs.parameters.namespace}}"
          - name: WAIT
            value: "{{inputs.parameters.wait}}"
          - name: TIMEOUT
            value: "{{inputs.parameters.timeout}}"
        resources:
          requests:
            cpu: 50m
            memory: 64Mi
          limits:
            memory: 256Mi

Version history

Read from the item's changelog. Each version has its own JSON document; the pinned catalogue vendors the manifest of the latest one, so that is the version that installs.

  1. 1.0.0 latest 2026-10-18

    Initial release.

    kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/kubectl-rollout-restart/1.0.0/template.yaml
    argo template create -n argo https://catalog.dagweave.com/api/v1/items/kubectl-rollout-restart/1.0.0/template.yaml

    version document, template.yaml

Run it once

After installing, from the command line.

argo submit -n argo --from workflowtemplate/kubectl-rollout-restart \
  -p name=checkout-api

Workflow that references it

A Workflow with the required parameters filled from the examples.

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: kubectl-rollout-restart-
spec:
  workflowTemplateRef:
    name: kubectl-rollout-restart
  arguments:
    parameters:
      - name: name
        value: "checkout-api"

As a step of a larger workflow

steps:
  - - name: kubectl-rollout-restart
      templateRef:
        name: kubectl-rollout-restart
        template: restart