Skip to content

Add support for kubectl rollout restart --all --all-namespaces #1751

Open
@merihilgor

Description

@merihilgor

What would you like to be added?

Please add support for the following usage patterns:

bash
CopyEdit
kubectl rollout restart --all kubectl rollout restart --all --all-namespaces

These would restart all rollout-capable resources (e.g., Deployment, StatefulSet, DaemonSet, possibly ReplicaSet) either:

  • in the current namespace (--all), or

  • across the whole cluster (--all --all-namespaces).

This would make rollout restart behave consistently with other kubectl verbs like get, describe, delete, etc., which allow generic use of --all and --all-namespaces.

Why is this needed?

Today, if I want to restart everything in a namespace or cluster, I need to write scripts like:

bash
CopyEdit
kubectl get deployments,statefulsets,daemonsets --all-namespaces -o name \ | xargs -n1 kubectl rollout restart

This is:

  • Inelegant

  • Not aligned with kubectl CLI ergonomics

  • Difficult to remember for newcomers or use in CI pipelines

There is no natural or native equivalent to:

bash
CopyEdit
kubectl delete pods --all --all-namespaces

But there should be a safe, controller-respecting alternative that uses rollout restart.

Benefits:

  • Safer cluster-wide restarts after config changes

  • Improved automation and scripting

  • Better developer experience

  • Prevents misuse of kubectl delete pods

Suggested Behavior:

Command | Behavior -- | -- kubectl rollout restart --all | Restarts all rollout-compatible resources in the current namespace kubectl rollout restart --all --all-namespaces | Restarts all rollout-compatible resources cluster-wide Optionally support --resource-types to filter | For example: --resource-types=deployments,statefulsets

Example Use Cases:

  • Restart everything after ConfigMap or Secret change

  • CI/CD rollback or redeploy logic

  • Cluster-wide rolling restarts in dev/test environments

  • Reboot mitigation without deleting pods


Would you like me to submit this issue on your behalf, or would you like to submit it yourself with this content?

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions