Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between a rollout restart and kill a pod

Tags:

kubernetes

What is the difference between a rollout restart of a deployment and killing a pod ? Both will recreate the pods no matter what.

like image 865
Mercer Avatar asked Sep 12 '25 08:09

Mercer


1 Answers

kubectl delete pod will only stop one replica of a deployment.

kubectl rollout restart deployment will delete and recreate all of the replicas.

There aren't really significant operational differences beyond this. The Deployment owns the Pods (via an intermediate ReplicaSet) and changes in the Pod spec will cause Kubernetes itself to delete the managed Pods. There are also some cases where a Pod will get deleted automatically (the pod and cluster autoscalers are obvious examples). You can delete an individual Pod by hand, or ask Kubernetes to have something else delete it, but the underlying mechanism is the same.

like image 98
David Maze Avatar answered Sep 15 '25 13:09

David Maze