Forrest logo
back to the kubectl tool

kubectl-rollout:tldr:41a17

kubectl-rollout: Start a rolling restart of a resource.
$ kubectl rollout restart ${resource_type}/${resource_name}
try on your machine

The kubectl rollout restart command is used to restart a resource in your Kubernetes cluster.

The ${resource_type}/${resource_name} part of the command is a placeholder for the specific resource you want to restart. You need to replace ${resource_type} with the type of the resource (e.g., deployment, statefulset, or daemonset) and ${resource_name} with the name of the actual resource.

For example, if you want to restart a deployment named "my-deployment", you would run the command kubectl rollout restart deployment/my-deployment.

When you execute this command, it triggers a rolling restart for the specified resource. A rolling restart means that the existing pods of the resource are terminated one by one, and new pods are created to replace them. This process ensures that your application remains available during the restart since there will always be a certain number of pods running.

By using kubectl rollout restart, you can update your resources with the latest changes or fix any issues without causing a downtime for your application.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the kubectl tool