 Policy
metadata:
  name: istio-egressgateway
  namespace: istio-system
spec:
  targets:
  - name: istio-egressgateway
  peers:
  - mtls: {}
EOF
</code></pre></li><li><p>Create an egress <code>Gateway</code> for your MongoDB service, and destination rules and a virtual service
to direct the traffic through the egress gateway and from the egress gateway to the external service.</p><pre><code class=language-bash data-expandlinks=true data-repo=istio>$ kubectl apply -f - &lt;&lt;EOF
apiVersion: networking.isti