Injecting Istio sidecar concurrently with the pod

10/19/2018

We are using Istio with Kubernetes and have automatic sidecar injection enabled. The Istio proxy pod gets injected a few seconds after the pod is created and this is causing issues with the start of our service. We are making a mongo connection at the start of service and since the Istio proxy is not up by that time with service entries imposed error occurs.

Is it possible to ensure that the sidecar gets injected concurrently with the pod?

-- Anshul Prakash
istio
kubernetes

1 Answer

10/19/2018

Not really from the Istio side. However, you can try adding readiness probes to your containers in your pods. You can add it with an initialDelaySeconds. This way they don't get any traffic until the Envoy proxy is fully operational.

Another option is to add a wrapper to your app in your container so that it waits for the envoy proxy to be injected until it really starts.

-- Rico
Source: StackOverflow