Skip to content

rollout-restart action

Description

RolloutRestartAction changes the standard pod-template restart annotation on one Deployment, StatefulSet or DaemonSet. Repeating the same timestamp does not make another change; a newer live timestamp supersedes an older request. A conflicting write fails the attempt. Retrying the same timestamp can recognize an accepted change and resume observation. Removing the action does not undo it.

Leave kubectl.kubernetes.io/restartedAt unconfigured in the typed resource so its updates preserve the marker. Explicit resource configuration retains authority over that value. Changing only @trigger does not request a new restart.

StatefulSet partitions and starting ordinals limit which replicas update. Completion can cover zero replicas or a subset, without claiming that every Pod restarted. Outputs describe the last successful invocation on Skip.

Source: internal/api/apps/v1/rollout_restart_action.go:30

Example usage:

imports: {
  kubernetes-apps-v1: 'github.com/cloudboss/unobin-library-kubernetes//api/apps/v1'
}

actions: {
  example: kubernetes-apps-v1.rollout-restart {
    # Set input fields here.
  }
}

Inputs

kind

string

required

name

string

required

namespace

optional(string)

Namespace defaults to the configured kubeconfig or library namespace.

expected-uid

string

required

ExpectedUID guards against restarting a replacement object.

restart-at

string

required

RestartAt is an explicit RFC3339 invocation timestamp, normalized to UTC.

wait-for-rollout

optional(boolean)

WaitForRollout defaults true. False returns after the template change and permits OnDelete staging. Paused Deployments are rejected in either mode.

timeout

optional(string)

Timeout bounds Kubernetes HTTP requests and polling; defaults to 10m.

Input Constraints

Kind rules

Requirement.

Rule logic
Require
input.kind == 'Deployment'
|| input.kind == 'StatefulSet'
|| input.kind == 'DaemonSet'

Name rules

Requirement.

Rule logic
Require
@core.is-match(input.name, '^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$')
&& @core.length(input.name) <= 253

Namespace rules

Conditional requirement.

Rule logic
When
input.namespace != null
Require
@core.is-match(input.namespace, '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$')
&& @core.length(input.namespace) <= 63

Expected uid rules

Requirement.

Rule logic
Require
@core.length(input.expected-uid) >= 1

Restart at rules

If set, restart-at must be an RFC3339 date and time.

Rule logic
Require
@core.is-format(input.restart-at, 'date-time')

Timeout rules

If set, timeout must be a positive duration.

Rule logic
Require
@core.is-format(input.timeout, 'positive-duration')

Outputs

server

string

api-version

string

kind

string

name

string

namespace

string

uid

string

restart-at

string

generation

integer

waited

boolean

strategy

string

partition

optional(integer)

selected-replicas

optional(integer)