<p>So I am in the process of migrating my bare metal cluster onto GKE and ran into an issue with the ingress. On my bare metal cluster, I used the ingress controller from <a href="https://github.com/nginxinc/kubernetes-ingress" rel="nofollow noreferrer">nginxinc</a> which worked fine. Below is a sample of an Ingress file of a particular deployment:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
namespace: mynamespace
name: app-ingress
annotations: 
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
rules:
- host: myhost
    http:
    paths:
    - path: /dev/appname(/|$)(.*)
        backend:
          serviceName: app
          servicePort: 80
</code></pre>

<p>Basically, when a user types in <code>myhost/dev/appname</code>, <code>myhost</code> is resolved to a HAProxy server. The proxy then routes the request to the NodePort that the ingress service is running on.</p>

<p>I tried to do the same thing on my GKE cluster with the only exception being that the Ingress controller on the GKE cluster is exposed using a <strong>LoadBalancer</strong> as per the <a href="https://github.com/nginxinc/kubernetes-ingress/blob/master/docs/installation.md" rel="nofollow noreferrer">documentation</a></p>

<p>However I get a <code>502</code> error if I try to access the URL.</p>

<p><strong>TL;DR:</strong> Looking for the best way to access various applications (deployments) deployed on a GKE cluster using URL's like: myhost/dev/firstapp and myhost/dev/secondapp etc.</p>

<p>You can use <strong>Kong Ingress</strong> as your ingress controller on GKE for your path based ingresses. You can install <strong>Kong Ingress</strong> from GCP Marketplace. It is easy to integrate and also supports various plugins for authenticating, monitoring etc. </p>

<p>You'll get detailed information and installation instructions from <a href="https://github.com/Kong/google-marketplace-kong-app#basic-usage" rel="nofollow noreferrer">https://github.com/Kong/google-marketplace-kong-app#basic-usage</a></p>
