Restart container within pod

前端 未结 9 1116
日久生厌
日久生厌 2020-12-04 07:04

I have a pod test-1495806908-xn5jn with 2 containers. I\'d like to restart one of them called container-test. Is it possible to restart a single co

9条回答
  •  时光说笑
    2020-12-04 07:37

    kubectl exec -it POD_NAME -c CONTAINER_NAME bash - then kill 1
    

    Assuming the container is run as root which is not recommended.

    In my case when I changed the application config, I had to reboot the container which was used in a sidecar pattern, I would kill the PID for the spring boot application which is owned by the docker user.

提交回复
热议问题