<p>We all know the use of ingress in a kubernetes cluster as a solution for path/context/url based routing for multiple services hosted on a kubernetes cluster. However, my requirement is a bit different. I have 2 clusters - EU n US regions hosted. Both these clusters host different set of applications app1, app2 in US cluster while app3 n app4 in EU cluster. Now i require an ingress type router sitting outside my clusters that i have a common entry point for all the applications ie <a href="http://www.example.com/us" rel="nofollow noreferrer">www.example.com/us</a> for US clusters and <a href="http://www.example.com/eu" rel="nofollow noreferrer">www.example.com/eu</a> for EU clusters. And then the corresponding ingress on each cluster will route based on app OR
<a href="http://www.example.com/app1" rel="nofollow noreferrer">www.example.com/app1</a>, /app2, /app3 etc based on applications which is routed to correct cluster and then ingress fwds to correct service in that cluster.</p>
<p>I have my custom domain <a href="http://www.example.com" rel="nofollow noreferrer">www.example.com</a>, but what is the solution or product i use in my network layer to implement this context/path based routing to the 2 clusters? DNS team said it cant be achieved at DNS level, and other load balancers follow round robin etc types algos which need all 4 apps on both the clusters but that is not a feasible solution for me. Can anyone suggest what to do here? My kubernetes clusters are in IBM Cloud. I cant have redundant services but need common entry point for both the clusters.</p>

Nidhi Goel
<p>You can have a look at the <a href="https://cloud.ibm.com/catalog/services/api-gateway" rel="nofollow noreferrer">IBM Cloud API Gateway</a> service.</p>
<p>For this example I was logged in to <a href="http://cloud.ibm.com/" rel="nofollow noreferrer">cloud.ibm.com</a> with my IBM ID, all steps were done within the UI. I have created an instance of the API Gateway service with the Lite plan (free of charge).</p>
<p>To give it a try go to <a href="https://cloud.ibm.com/catalog/services/api-gateway" rel="nofollow noreferrer">IBM Cloud API Gateway</a>, choose a meaningful name for your instance of the API Gateway service and hit the &quot;Create&quot; button.</p>
<p>As a next step find the button &quot;Create API Proxy&quot;, hit it and in the next screen choose a name for your API, for instance USA, specify the base path /us and copy the URL of your US based application.</p>
<p>Repeat this step and choose a different name (for instance EU), this time specify the base path /eu and copy the URL of your EU based application.</p>
<p>Now you have a setup that is very close to what you have been looking for. Both API Proxies share the same default domain and the requests for path '/us' are routed to the US based application and the requests for path '/eu' are routed to the EU based application.</p>
<p>To replace the default domain with your custom domain you need to navigate to &quot;API Management&quot; -&gt; &quot;Custom Domains&quot; and provide the details.</p>
<p>I hope this helps. I tried the setup with an <a href="https://cloud.ibm.com/cloudfoundry/overview" rel="nofollow noreferrer">IBM Cloud Cloud Foundry</a> sample app as the application for EU and an <a href="https://cloud.ibm.com/codeengine/overview" rel="nofollow noreferrer">IBM Cloud Code Engine</a> application as the US based app and for this simple test everything worked as expected with the default domain of my API Gateway instance.</p>
<p>Please comment if this also works in your case where your apps are running on <a href="https://cloud.ibm.com/kubernetes/overview" rel="nofollow noreferrer">Kubernetes</a> cluster within IBM Cloud.</p>
