<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>I don't think you can control the order other than listing the containers in a particular order in your pod spec. So, I recommend you configure a <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/" rel="nofollow noreferrer">Readiness Probe</a> so that you are pod is not ready until your service can send some traffic to the outside.</p>
