I want to restart a pod (that is part of a deployment), without having to restart/replace the entire deployment.
I have tried kubectl replace --force -f file.yaml
but that restarts the whole deployment. I want to just restart the current pod that is live.
Any thoughts are appreciated.
Why not just kubectl delete pod <pod>
? It will remove your single pod and schedule new in it's place.
If rescheduling is a problem, you could try to kill the process running inside the container in pod with something like kubectl exec <pod> <container> kill 1
, but some processes might not be willing to surrender easily :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With