Hey guys,
I have installed Grafana (grafana/grafana:7.2.0) via Helm with additional settings.
This is the additional settings
persistence:
enabled: true
persistentVolume:
storageClass: standard
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus-server
access: proxy
isDefault: true
This is how I installed
helm install grafana grafana/grafana -f grafana-values.yml --namespace monitoring
The pod is up and running. I tried port forwarding the Pod to local and I can access it via local browser just fine.
kubectl port-forward <grafana pod name> 3000
# logs
t=2020-10-12T07:33:49+0000 lvl=info msg="Request Completed" logger=context userId=0 orgId=0 uname= method=GET path=/ status=302 remote_addr=127.0.0.1 time_ms=0 size=29 referer=
t=2020-10-12T07:34:00+0000 lvl=info msg="Successful Login" logger=http.server User=admin@localhost
Now, I tried putting Nginx Pod in front and reverse proxy back to the Grafana Service. The Nginx config
server {
listen [::]:80;
listen 80;
server_name grafana.example.com;
client_max_body_size 50M;
large_client_header_buffers 4 32k;
location / {
include /etc/nginx/sites-enabled/toolings/auth.conf; # basic auth
proxy_pass http://grafana.monitoring.svc.cluster.local;
}
}
However, when I go to grafana.example.com in the browser, I get this message
{"message":"Invalid username or password"}
this is the log
t=2020-10-12T07:34:38+0000 lvl=eror msg="Invalid username or password" logger=context error="Invalid Username or Password"
t=2020-10-12T07:34:38+0000 lvl=info msg="Request Completed" logger=context userId=0 orgId=0 uname= method=GET path=/ status=401 remote_addr=10.148.0.177 time_ms=0 size=42 referer=
Anything that I missed? Or any other info that I need to provide?
Edit:
I have tried resetting the password via kubectl
as well
kubectl exec -it -n monitoring <pod_name> -- /bin/sh -c "/usr/share/grafana/bin/grafana-cli admin reset-admin-password test_password"
After that, I can log in with the new password when I port-forward the Pod but still the same issue when I tried to use it via Nginx reverse proxy.
Thanks, guys