Pod with restart policy never in Kubernetes

2/27/2019

I have 2 containers in a pod. Main container and side car for sending logs to ELK.

I don't want the main container to restart when it fails, but I need the side car to get restarted automatically when it fails.

Setting RestartPolicy to Never is not restarting the side car also. Is there any way to set the restart policy at the container level?

-- user1578872
kubernetes

1 Answer

2/28/2019

We have a proposal to formalize sidecar container lifecycles: https://github.com/kubernetes/enhancements/blob/master/keps/sig-apps/sidecarcontainers.md

Take a look at that and see if it gets to what you need?

-- Tim Hockin
Source: StackOverflow