Restart container within pod

前端 未结 9 1112
日久生厌
日久生厌 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:42

    The whole reason for having kubernetes is so it manages the containers for you so you don't have to care so much about the lifecyle of the containers in the pod.

    Since you have a deployment setup that uses replica set. You can delete the pod using kubectl delete pod test-1495806908-xn5jn and kubernetes will manage the creation of a new pod with the 2 containers without any downtime. Trying to manually restart single containers in pods negates the whole benefits of kubernetes.

提交回复
热议问题