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

Grafana Too Many Redirects error

Open toniGrabulosa opened this issue 1 year ago • 2 comments

Hello!

Just installed the chart on my k8s cluster

With these values:

# replica count
replicaCount: 1
imageTag: v0.21.0

# image pull secrets
imagePullSecrets: []

#the common environments for all pods except grafana, grafana needs to be set in grafana section seperately
commonEnvs:
  TZ: "Europe/Andorra"

mysql:
  # if use external mysql server, please set true
  # by default using false, chart will create a single mysql instance
  useExternal: true

  # the external mysql server address
  externalServer: X.X.X.X 

  # external mysql port
  externalPort: 3306


# dependency chart values
grafana:
  enabled: true
  #if grafana enabled is false, then external url should be provided
  image:
    repository: devlake.docker.scarf.sh/apache/devlake-dashboard
    tag: v0.21.0
  adminPassword: ""
  #the secret name should be as same as .Values.option.connectionSecretName
  envFromSecrets:
    - name: "devlake-mysql-auth"
  #keep grafana timezone same as other pods, which is set by .Values.commonEnvs.TZ
  env:
    TZ: "Europe/Andorra"


lake:
  #extra envs from an existing secret
  # extraEnvsFromSecret: ""
  encryptionSecret:
    # The name of secret which contains keys named ENCRYPTION_SECRET
    autoCreateSecret: false
    secretName: "devlake-encryption-key"

ui:
  basicAuth:
    enabled: true
    secretName: "devlake-ui-basicauth"
    autoCreateSecret: false

ingress:
  enabled: true
  enableHttps: true
  # Set to false if you want to use a different ingress controller
  useDefaultNginx: false
  # ingress class name, example: alb for AWS load balancer controller
  className: gce
  # domain name for hosting devlake, must be set if ingress is enabled
  hostname: devlake.myapp.com
  annotations:
    kubernetes.io/ingress.class: gce
  # url prefix, not works right now, keep "/"
  prefix: /
  # if using https provides the certificates secret name
  tlsSecretName: "devlake-tls"
  # ingress http port
  httpPort: 80
  # ingress https port
  httpsPort: 443

  extraPaths: []
#  extraPaths:
#    - path: /*
#      pathType: ImplementationSpecific
#      backend:
#        service:
#          name: ssl-redirect
#          port:
#            name: use-annotation

option:
  # database type, supported: [mysql]
  database: mysql
  # the existing k8s secret name of db connection auth. The secret name should be as same as .Values.grafana.envFromSecret
  connectionSecretName: "devlake-mysql-auth"
  autoCreateSecret: false

It has been deployed on GCP with a GCP LoadBalancer & Ingress.

The issue that I've experimented is that when going to myapp.com/grafana I got a too many redirects error on my browser.

Tried several browsers, incognito mode, and no luck.

Investigating a bit about the grafana.ini file, I've figured out that I need to put this into the grafana.ini section:

  grafana.ini:
    server:
      serve_from_sub_path: "true"

Performing a helm upgrade command, with that updated value, it made my setup to work properly. The too many redirects erros is gone.

I can make a PR to add that to the helm chart's values, however I'm opening this issue just to be sure its a mal function of the devlake chart.

Thx for your time!

toniGrabulosa avatar May 06 '24 07:05 toniGrabulosa

@toniGrabulosa thanks a lot for reporting this issue, using subpath is intended, not sure why this env variable doesn't work anymore. Could you kindly make a pr to add this fix in the helm chart? image

ZhangNing10 avatar May 07 '24 03:05 ZhangNing10

Alright @ZhangNing10, As far as I can see, this change on the Dockerfile has been introduced just 3 weeks ago, and the image that I'm using: devlake.docker.scarf.sh/apache/devlake-dashboard:v0.21.0 does not have this change.

I've got the PR ready.

https://github.com/apache/incubator-devlake-helm-chart/pull/284

:-)

toniGrabulosa avatar May 07 '24 06:05 toniGrabulosa