Initial implementation of the sidecar injector for k8s.
TL;DR
With configuration like this kube-sidecar-injector will make sure that any
container that runs in EKS fargate will have prometheus node-exporter sidecar
running next to it:
Single webhook configuration can be configured to apply multiple injection
rules. However, if these rules should interact somehow (for example rule A
introduces changes that rule B is supposed to act upon) then these rules
should be placed into separate webhooks.
It's not possible for the webhook to know at the runtime whether the patch it
generates is invalid.
For example, if you try to inject a container that has port name of more than
15 characters long k8s will not allow the modified pod to be deployed.
In situations like this, k8s will infinitely attempt the webhook admission,
without ever creating the pod. In order to troubleshoot this issue it could
help to see actual underlying error from k8s with: