<p>I have a sidecar that only allows egress traffic on the namespace it is being deployed. This limits also external calls. Is there a way to add an external host to the sidecar, something like:</p>
<pre><code>          apiVersion: &quot;networking.istio.io/v1beta1&quot;,
          kind: &quot;Sidecar&quot;,
          metadata:{
            name: &quot;egress-sidecar&quot;,
            namespace: &quot;namespace&quot;,
          },
          spec:{
                workloadSelector:{
                    labels:{
                        app: 'target_app'
                    }
               },
               egress:[
                {
                    hosts:[
                             &quot;namespace/*&quot;,
                             &quot;google.com/*&quot; # &lt;--- something like this, this does not work
                          ]
                }
              ],
              outboundTrafficPolicy:{
                    mode: &quot;REGISTRY_ONLY&quot;
              }
          }
</code></pre>

Luca Vlad
<p>Ik think you'll need at least a ServiceEntry (<a href="https://istio.io/latest/docs/reference/config/networking/service-entry/" rel="nofollow noreferrer">https://istio.io/latest/docs/reference/config/networking/service-entry/</a>) for the external service (e.g. <a href="http://www.google.com" rel="nofollow noreferrer">www.google.com</a>) and then you can refer to it in the egress section of your Sidecar definition. Depending in which namespace you register the mentioned ServicEntry you can define the following in the hosts section under the egress section of your Sidecar definition :</p>
<p>*/www.google.com (ServiceEntry anywhere in the Service Mesh)</p>
<p>./www.google.com (ServiceEntry in the same namespace as your Sidecar definition)</p>
<p>(<a href="https://istio.io/latest/docs/reference/config/networking/sidecar/#IstioEgressListener" rel="nofollow noreferrer">https://istio.io/latest/docs/reference/config/networking/sidecar/#IstioEgressListener</a>)</p>
