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

Linkerd viz integration with Grafana is broken #122

Closed
ricsanfre opened this issue Apr 15, 2023 · 1 comment · Fixed by #123
Closed

Linkerd viz integration with Grafana is broken #122

ricsanfre opened this issue Apr 15, 2023 · 1 comment · Fixed by #123
Labels
bug Something isn't working

Comments

@ricsanfre
Copy link
Owner

ricsanfre commented Apr 15, 2023

From linkerd-viz when trying to open any Grafana dashboard, the following message error appears in the browser:

{"message":"invalid username or password","traceID":""}

Grafana's log:

logger=context t=2023-04-15T15:41:08.277401926Z level=error msg="invalid username or password" error="invalid username or password" traceID=
logger=context userId=0 orgId=0 uname= t=2023-04-15T15:41:08.277471789Z level=info msg="Request Completed" method=GET path=/d/linkerd-namespace status=401 remote_addr=10.42.3.42 time_ms=16 duration=16.023782ms size=56 referer=
@ricsanfre ricsanfre added the bug Something isn't working label Apr 15, 2023
@ricsanfre
Copy link
Owner Author

ricsanfre commented Apr 15, 2023

Integration was broken when I migrated to ArgoCD. Before migration, linkerd-viz namespace was meshed with linkerd, and two Traefik middlewares were used for linkerd-viz ingress resource: HTTP Basic Auth Middleware and Linkerd custom header Middleware.
Meshing linkerd-viz and adding custom header middleware again solves the issue.

It seems that Grafana does not work properly behind a HTTP proxy when basic auth is used. Traefik is passing basic auth user and passwords that seems to cause the error in Grafana.See this post
Grafana does not try to authenticate the user by other means if basic auth headers are present and returns a 401 unauthorized error.

With the second Traefik middleware, after Basic Auth, the auth headers seems not to be passed to Grafana.

Another way to solve the issue is configuring Traefik Basic auth middleware to remove auth headers before forwarding the request to the service . See Basic Auth Midleware removeHeader option

# Basic-auth middleware
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: basic-auth
  namespace: traefik
spec:
  basicAuth:
    secret: basic-auth-secret
    removeHeader: true

With this second solution, it is not needed to mesh linkerd-viz to make the Linkerd-viz/Grafana integration working.

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

Successfully merging a pull request may close this issue.

1 participant