![Forrest logo](/images/logo.png)
kubectl-rollout:tldr:41a17
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.