tumblr / k8s-sidecar-injector

Kubernetes sidecar injection service
Apache License 2.0
345 stars 75 forks source link

add support for initContainers #7

Closed byxorna closed 5 years ago

byxorna commented 5 years ago

What's going on?

We should support initContainers in our injection configs

https://github.com/tumblr/k8s-sidecar-injector/pull/9 and https://github.com/tumblr/k8s-sidecar-injector/pull/8 address this

komapa commented 5 years ago

I thought initContainers cannot be injected?

byxorna commented 5 years ago

@komapa i am going to reinvestigate when i have time, and confirm. it would be great if we could; if not, ill have links here explaining exactly why they cant be patched into a pod.

iwilltry42 commented 5 years ago

@komapa I couldn't find any resource regarding your concerns. Only a wrong order of admission controllers might prevent injecting containers, e.g. PodSecurityPolicies (but containers in general, not only initContainers). Anyways I can confirm for #8, that it works. I tested it on Minikube and in our development cluster (though we don't have stuff like PodSecurityPolicies there).

byxorna commented 5 years ago

@komapa @iwilltry42 I initially looked into this (way before this was opensourced) and I thought I found some reason I couldnt inject initContainers; I was clearly very mistaken :)

Thanks for sorting this out!

byxorna commented 5 years ago

Closed via https://github.com/tumblr/k8s-sidecar-injector/pull/8