<p>I am trying to implement a service mesh to a service with Kubernetes using Istio and Envoy. I was able to set up the service and istio-proxy but I am not able to control the order in which the container and istio-proxy are started.</p>

<p>My container is the first started and tries to access an external resource via TCP but at that time, istio-proxy has not completely loaded and so does the ServiceEntry for the external resource</p>

<p>I tried adding a panic in my service and also tried with a sleep of 5 seconds before accessing the external resource.</p>

<p><strong>Is there a way that I can control the order of these?</strong></p>

DoIt
<p>On istio version 1.7.X and above you can add configuration option <code>values.global.proxy.holdApplicationUntilProxyStarts</code>, which causes the sidecar injector to inject the sidecar at the start of the pod’s container list and configures it to block the start of all other containers until the proxy is ready. This option is disabled by default.</p>
<p>According to <a href="https://istio.io/latest/news/releases/1.7.x/announcing-1.7/change-notes/" rel="nofollow noreferrer">https://istio.io/latest/news/releases/1.7.x/announcing-1.7/change-notes/</a></p>
