<p>If I have a kubernetes cluster in AKS with an nginx-ingress, can I then forward certain traffic to something external to the cluster like an App Service?</p>

<p><a href="https://i.stack.imgur.com/spuQJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/spuQJ.png" alt="enter image description here"></a></p>

<p>If I open my-domain.com/svc3, I want traffic to be routed to the App Service.</p>

<p>If this is not directly possible, what would be the best solution?</p>

<p>1) I could put an additional load balancer (like AppGateway) in front of both the AKS cluster and the App Service</p>

<p>2) I could instantiate a second nginx as a service, which then routes traffic to the app service</p>

<p>3) ... ?</p>

<p>I think you can use mapping external service to kubernetes :</p>

<pre><code>kind: Service
apiVersion: v1
metadata:
 name: external-service
Spec:
 type: ClusterIP
 ports:
 - port: 80
   targetPort: 80
</code></pre>

<p>here the endpoint :</p>

<pre><code>kind: Endpoints
apiVersion: v1
metadata:
 name: external-service
subsets:
 - addresses:
     - ip: 101.280.1.44
   ports:
     - port: 80
</code></pre>

<p>For more information you can check this video also : </p>

<p><a href="https://www.youtube.com/watch?v=fvpq4jqtuZ8" rel="nofollow noreferrer">https://www.youtube.com/watch?v=fvpq4jqtuZ8</a></p>

<p>you can also read this document for more information : <a href="https://cloud.google.com/blog/products/gcp/kubernetes-best-practices-mapping-external-services" rel="nofollow noreferrer">https://cloud.google.com/blog/products/gcp/kubernetes-best-practices-mapping-external-services</a></p>
