pmint93/helm-charts

Enable support for sub-path ingress

Closed this issue ยท 2 comments

Hello ๐Ÿ˜„

I'd like to deploy this metabase chart so that I can access metabase from domain subpath - eg: my.domain/metabase.

I am already able to access from the root of my.domain using ingress-nginx ingress controller:

siteUrl: http://my.domain
ingress:
  enabled: true
  className: nginx
  hosts:
    - my.domain
  path: /
  pathType: Prefix
readinessProbe:
  initialDelaySeconds: 100

This works fine and I can access metabase from my.domain with no problems.

But things don't work if I try to configure a subpath:

siteUrl: http://my.domain/metabase
ingress:
  enabled: true
  className: nginx
  hosts:
    - my.domain
  path: /metabase/
  pathType: Prefix
readinessProbe:
  initialDelaySeconds: 100

I have noticed some discussions where people have managed to get sub-path access working using a reverse proxy:

I'm wondering if there is some way we can bootstrap this chart to support access from a domain sub-path?

There are 2 common ways to solve this problem:

  1. Config metabase to expect itself running under a sub-path: discussing is in the issue you mentioned earlier

  2. Use a L7 proxy that serve at sub-path then rewrite requests to root-path when forwarding it to metabase

    Depends on what's ingress controller you are using, in example of ingress-nginx you can look further at this https://kubernetes.github.io/ingress-nginx/examples/rewrite/

Thanks! It works when I add the rewrite-target annotation:

siteUrl: http://my.domain
ingress:
  enabled: true
  className: nginx
  hosts:
    - my.domain
  path: /metabase(/|$)(.*)
  pathType: ImplementationSpecific
  annotations:
    nginx.ingress.kubernetes.io/use-regex: "true"
    nginx.ingress.kubernetes.io/rewrite-target: /$2
readinessProbe:
  initialDelaySeconds: 100