cetic/helm-nifi

[cetic/helm-nifi] ingress path other than / doesn't work

RabbidDog opened this issue · 5 comments

Describe the bug
the application UI should be accessible though the custom ingress path

Version of Helm and Kubernetes:
helm: v2.14.3
kubernetes: v1.15.1

What happened:
the chart allows us to set the ingress.path variable. I would like to host the application at a path other than '/'. for e.g. at '/demo-nifi'. So I expected that setting ingress.path: '/demo-nifi' would work without additional changes i.e the application ui will be available at host/demo-nifi/nifi and all calls would be made to host/demo-nifi/{..}. But all REST calls from the browser assume that the urls are host/{..}

What you expected to happen:
ui uses custom path set in ingress.path

How to reproduce it (as minimally and precisely as possible):
set ingress.path: /demo-nifi

Anything else we need to know:

if forgive any ignorance about possible advanced configuration that can be done to resolve this issue

Hello @RabbidDog,

Thanks for your bug report, I was able to reproduce your bug.

When the ingress.path: /nifi, it works fine.
When i set another path (for instance /demo-nifi), nifi redirects me automatically to /nifi which ends in 404 error.

Maybe there is a configuration in nifi to use another path than /nifi.

Thanks for the info. I will go through the docs and try to find a solution that works for me.

So, we finally decided to use nifi in our cluster and figured out that the following changes in the values.yaml will do the trick:

properties:
  safetyValve:
    nifi.web.proxy.context.path: /demo, /demo/nifi

for Traefik ingress controller

ingress:
  enabled: true
  path: /demo
  annotations:
    kubernetes.io/ingress.class: traefik
    traefik.ingress.kubernetes.io/rule-type: PathPrefixStrip
    ingress.kubernetes.io/custom-request-headers: X-ProxyContextPath:/demo||X-ProxyPort:80||X-ProxyScheme:http

For Nginx ingress controller

ingress:
  enabled: true
  path: /demo(/|$)(.*)
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /$2
    nginx.ingress.kubernetes.io/configuration-snippet: |
      proxy_set_header 'X-ProxyContextPath' '/demo';
      proxy_set_header 'X-ProxyPort' '80';
      proxy_set_header 'X-ProxyScheme' 'http';

Thanks for the explanation @RabbidDog !