incubator-devlake-helm-chart icon indicating copy to clipboard operation
incubator-devlake-helm-chart copied to clipboard

grafana URL localhost issue after upgrading

Open duhow opened this issue 10 months ago • 6 comments

After upgrading Helm Chart from 0.21.0-beta3 to 1.0.0-beta5 ,
Dashboard link in DevLake UI shows https://www.fulldomain.com/grafana, but then Grafana redirects to http://localhost/grafana .

duhow avatar Apr 23 '24 08:04 duhow

Fixed with new values:

  • had to force https instead of using internal grafana %(protocol)
  • remove rewrite-target by disabling the useDefaultNginx value.
grafana:
    grafana.ini:
        server:
            domain: www.fulldomain.com
            root_url: "https://%(domain)s/grafana"
            
ingress:
    useDefaultNginx: false

duhow avatar Apr 23 '24 08:04 duhow

@duhow, tried what you suggested I deploy with argocd/helm and use the built-in grafana, getting too many redirects after but forming of url looks ok.

s7an-it avatar Apr 24 '24 16:04 s7an-it

Had to write custom ingress - disabled the one from chart and based on what you did: grafana.ini: server: domain: devlake.example.customer.com root_url: "https://%(domain)s/grafana" useDefaultNginx: false

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: devlake-ingress
  namespace: devlake
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    nginx.ingress.kubernetes.io/use-forwarded-headers: "true"
spec:
  rules:
    - host: devlake.example.customer.com
      http:
        paths:
          - path: /grafana
            pathType: Prefix
            backend:
              service:
                name: devlake-grafana
                port:
                  number: 80
          - path: /
            pathType: Prefix
            backend:
              service:
                name: devlake-ui
                port:
                  number: 4000

s7an-it avatar Apr 24 '24 17:04 s7an-it

@s7an-it note that the issue with the built-in Ingress is that default ingress.useDefaultNginx adds a rewrite-target, which in turn makes Grafana path go crazy (as it is removed internally, then Grafana never sees it, but client receives the request) https://github.com/apache/incubator-devlake-helm-chart/blob/9c9654f2198dfc18c4bf41899f8859248f136ba4/charts/devlake/templates/ingresses.yaml#L39-L41

duhow avatar Apr 24 '24 19:04 duhow

hi @duhow @s7an-it , thanks for reporting the issue. I have created pr https://github.com/apache/incubator-devlake-helm-chart/pull/278 to remove the rewrite-target part, and i tested by my side, no need to adjust values to below part any more:

Fixed with new values:

  • had to force https instead of using internal grafana %(protocol)
  • remove rewrite-target by disabling the useDefaultNginx value.
grafana:
    grafana.ini:
        server:
            domain: www.fulldomain.com
            root_url: "https://%(domain)s/grafana"
            
ingress:
    useDefaultNginx: false

ZhangNing10 avatar Apr 25 '24 07:04 ZhangNing10

@duhow , are you using nginx ingress? if so, could you help check by your side whether my pr works? we are not using nginx ingress ^^

ZhangNing10 avatar Apr 25 '24 09:04 ZhangNing10