k8s-sidecar-injector icon indicating copy to clipboard operation
k8s-sidecar-injector copied to clipboard

Feature request: inject container at the top of the list of containers

Open ribbybibby opened this issue 3 years ago • 0 comments

Given that the sidecar containers KEP seem to be a ways off, I would love to take advantage of this workaround for delaying application startup until sidecar containers are ready by injecting sidecars at the top of the list of containers, rather than at the bottom, and using a post-startup lifecycle hook to check that the sidecar has started up.

At the moment containers are appended to the bottom of the pod's containers. To take advantage of the workaround with this sidecar injector it would need to be possible to prepend to the top of the list.

I'm not sure what the best way to implement this would be. This may be one of a few, if not the only, cases where the order of containers in the list makes any appreciable difference to the functionality of the pod, so it could be acceptable to simply switch the logic to append at the top of the containers, rather than the bottom.

Or, perhaps a separate field? A separate list of containers like containersPrepend: []?

ribbybibby avatar Aug 27 '20 12:08 ribbybibby