I use linkerd for one of our application. I need some pre-check conditions to be done which also checks for linkerd availability and I want to run that init container AFTER linker-init container runs. However, linkerd-init containers are automatically created once we add below injection/annotation:
annotations: linkerd.io/inject: enabled
I want to know if there is a way to run my initcontainer last, which is after linkerd-init is run. linkerd-init is not part of the pod spec, it automatically creates the initcontainer, but when I mention my initcontainer in pod spec, my container takes precedence over linkerd-init. :(
Please help if there is a way to ensure my init container always runs last in the sequence of all other init containers.
Unfortunately that’s not possible at the moment. A lot of people rely on init containers to set-up their workloads and often these init containers have to make network calls. Running them after linkerd-init would result in an error since redirect rules would force traffic through the proxy’s listener (which is not yet up).
We had a similar request in the past, you can see the issue here. A simple way would be to use the cni plugin, or raise a similar issue to the one I have linked.