Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grafana URL localhost issue after upgrading #275

Open
duhow opened this issue Apr 23, 2024 · 6 comments
Open

grafana URL localhost issue after upgrading #275

duhow opened this issue Apr 23, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@duhow
Copy link
Contributor

duhow commented Apr 23, 2024

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
Copy link
Contributor Author

duhow commented Apr 23, 2024

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

@s7an-it
Copy link

s7an-it commented Apr 24, 2024

@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
Copy link

s7an-it commented Apr 24, 2024

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

@duhow
Copy link
Contributor Author

duhow commented Apr 24, 2024

@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)

{{- if .Values.ingress.useDefaultNginx }}
nginx.ingress.kubernetes.io/rewrite-target: /$2
{{- end}}

@Startrekzky Startrekzky added the bug Something isn't working label Apr 25, 2024
@ZhangNing10
Copy link
Contributor

hi @duhow @s7an-it , thanks for reporting the issue. I have created pr #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
Copy link
Contributor

@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 ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants