K8s pods restart strategy

Pod restart strategy has three kinds of default is Always. 

Always: container failure, kubelet automatically restart the container; 
OnFailure: terminating operation of the container and the exit code is not 0 restart; 
Never: regardless of status, kubelet not restart the container. 
Failure of the vessel by the kubelet to five minutes for the upper limit of the exponential backoff delay (10 seconds, 20 seconds, 40 seconds ...) restart and reset after the successful implementation of ten minutes. 

In yaml layout file restartPolicy: OnFailure and container to be side by side.

 

 This article refers to https://www.cnblogs.com/xingyunfashi/p/10722184.html

Guess you like

Origin www.cnblogs.com/lfyu/p/11961888.html