Restart Pod inside Kubernetes Container
Quote from moshe on 02/11/2020, 8:42 amProblem
User wants to restart pod without reseting to default pods settings. for example making changes that requires reload for several applications inside the pods
Solution
You can use some commands available inside the pods to restart it
kubectl exec POD_NAME -c CONTAINER_NAME /sbin/killall5
kubectl exec -it [POD_NAME] -c [CONTAINER_NAME] — /bin/sh -c “kill 1”
kubectl exec -it [POD_NAME] -c [CONTAINER_NAME] — /bin/sh -c “/sbin/reboot”
Example
kubectl exec prom-operator-grafana-6848c59c99-zn7hq -c grafana /sbin/reboot -n monitoring
Problem
User wants to restart pod without reseting to default pods settings. for example making changes that requires reload for several applications inside the pods
Solution
You can use some commands available inside the pods to restart it
kubectl exec POD_NAME -c CONTAINER_NAME /sbin/killall5
kubectl exec -it [POD_NAME] -c [CONTAINER_NAME] — /bin/sh -c “kill 1”
kubectl exec -it [POD_NAME] -c [CONTAINER_NAME] — /bin/sh -c “/sbin/reboot”
Example
kubectl exec prom-operator-grafana-6848c59c99-zn7hq -c grafana /sbin/reboot -n monitoring