Jonathan Rioux
Jonathan Rioux

Reputation: 1096

k8s - Keep pod up even if sidecar crashed

I have a pod with a sidecar. The sidecar does file synchronisation and is optional. However it seems that if the sidecar crashes, the whole pod becomes unavailable. I want the pod to continue serving requests even if its sidecar crashed. Is this doable?

Upvotes: 2

Views: 1971

Answers (1)

Kamol Hasan
Kamol Hasan

Reputation: 13546

Set pod's restartPolicy to Never. It will prevent the kubelet from restarting your pod even if one of your containers failed.

If a Pod is running and has two Containers. Container 1 exits with failure. If the restartPolicy it set to Never, the kubelet will not restart Container and the Pod's phase stays Running.

Upvotes: 2

Related Questions