What happens one of the container process crashes in multiple container POD?

6/26/2020

Normally in single container POD, The pod will be restarted when the primary process of the container crashes.

What will happen in case of multiple container PODs if one if process in the second container crashes ? Will the POD be restarted ?

-- Chandu
containers
kubernetes

1 Answer

6/26/2020

From the docs here

Pod is running and has two Containers. Container 1 exits with failure.

  1. Log failure event.
  2. If restartPolicy is:

    • Always: Restart Container; Pod phase stays Running.
    • OnFailure: Restart Container; Pod phase stays Running.
    • Never: Do not restart Container; Pod phase stays Running

So pod is not restarted or the other container is not restarted , only the exited container is restarted based on the restartPolicy

-- Arghya Sadhu
Source: StackOverflow