<p>I'm using k8s to deploy my app which has 3 parts. The main website (landing page), App component 1 (by admins only) and App Component 2 (for paid users). I've recently come across a pattern where there is a main external load balancer, and an ingress for each part of the app. Eg:</p>

<pre><code>LB 
  -&gt; Ingress1 -&gt; Main App
  -&gt; Ingress2 -&gt; App Component 1 (only accessible by admins)
  -&gt; Ingress3 -&gt; App Component 2 (only accessible by paid users)
</code></pre>

<p>Is it common to have an architecture like this? 
Could someone point me to a few good examples (using k8s) which are deploying apps like this. Thanks in advance!</p>

Panda
<p>GKE does not support using Ingress or Load Balancers as backends for other Load Balancers. Instead, you can do one of the following:</p>

<ol>
<li><p>Create an ingress for each entry point (this is more expensive)</p></li>
<li><p>Create a single Ingress using multiple paths (one for each backend). This will route traffic based on the URL entered. This is likely your best and most cost efficient solution. For security, you can incorporate <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/cloud-armor-backendconfig" rel="nofollow noreferrer">Cloud Armor</a> to ensure that users only access paths they should be accessing.</p></li>
<li><p>Create an Ingress to expose your main application, then use service type LoadBalancers to expose the paid portal and the Admin portal. These will work as layer 4 (so you will need to have a DNS record to point the admin and paid URLs to the appropriate IP). You can configure the Load Balancer <a href="https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service" rel="nofollow noreferrer">spec.loadBalancerSourceRanges</a> field to only allow specific IP ranges to restrict access to the admin portal</p></li>
</ol>

<p>On another note, there is little benefit in your layout to have a Load Balancer in front of the Ingresses since you aren't looking to balance traffic between the 3 ingresses. You want all traffic hitting the ingresses and then being directed to the right backend and balanced between serving pods.</p>
