Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (12.7k points)
hello, i have 2 containers within a pod, i want to restart one of the containers ,is it possible? if yes how ?

1 Answer

0 votes
by (29.5k points)
edited by

No there is not set command for restarting a container inside a pod through kubectl but what you can try is killing the container, when you do this your pod fails and Kubernetes automatically recreates is, to do this you need to do is run the command mentioned below

kubectl exec POD_NAME -c CONTAINER_NAME /sbin/killall5

It seems like you are new to Kubernetes, I just want to give you advice before I leave, If you are thinking about making a career in this field and Kubernetes certification training helps a lot while working in a production environment so if you have resources please go for it!  anyway I hope I resolved your issue 

Browse Categories

...