Pranil Kar:
Hi Team, Any idea on why we use “–restart=Never” ?
Talal Humaidi:
Always means that the container will be restarted even if it exited with a zero exit code (i.e. successfully). This is useful when you don’t care why the container exited, you just want to make sure that it is always running (e.g. a web server). This is the default.
OnFailure means that the container will only be restarted if it exited with a non-zero exit code (i.e. something went wrong). This is useful when you want accomplish a certain task with the pod, and ensure that it completes successfully - if it doesn’t it will be restarted until it does.
Never means that the container will not be restarted regardless of why it exited.
Talal Humaidi:
For example if you ran a pod with a busybox image to test something for example to curl to another pod to test something related to networking you just want to do 1 thing and exit the process without the need of restarting
Pranil Kar:
Thanks @Talal Humaidi… Nice explanation.
Talal Humaidi:
You are welcome