vmware-archive / gangway

An application that can be used to easily enable authentication flows via OIDC for a kubernetes cluster.
Apache License 2.0
409 stars 113 forks source link

Support for path based routing #41

Closed dkirrane closed 5 years ago

dkirrane commented 6 years ago

Hi, is there anyway to set the base directory (root context) for gangway? I have a single DNS entry for my cluster and I use path-based routing to the various UIs in my Ingress resources i.e. path: /gangway

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: gangway
  namespace: gangway
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - host: mycluster.example.com
    http:
      paths:
      - backend:
          serviceName: gangwaysvc
          servicePort: http
        path: /gangway
  tls:
  - hosts:
    - mycluster.example.com
    secretName: my-tls

The problem is the gangway SIGN IN button routes to https://mycluster.example.com/login/ instead of https://mycluster.example.com/gangway/login image

Click Sign In and you hit the default backend https://mycluster.example.com/login:

image

dkirrane commented 5 years ago

Getting back to this after some time.. I tried setting gangway ingress annotations

    nginx.ingress.kubernetes.io/app-root: /gangway
    nginx.ingress.kubernetes.io/use-port-in-redirects: "true"

But same problem

stevesloka commented 5 years ago

Hey @dkirrane, I just made a PR (#69) which will allow you to configure this path. You won't need the redirect annotations in your ingress.