I use minikube to run a local kubernetes cluster. I deploy grafana using helm from this repo: https://grafana.github.io/helm-charts. If I use port-forwarding it is perfectly accessible, so I tried to setup an ingress on chart-example.local/grafana. When I curl chart-example.local/grafana
it works as well. but when I use minnikube tunnel
and localhost/grafana
in my browser I get 404 Not Found nginx
.
I made the following changes to the helm values file:
custom-values.yml
:
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/use-regex: "true"
path: /grafana/?(.*)
pathType: Prefix
hosts:
- chart-example.local
grafana.ini:
server:
domain: "{{ if (and .Values.ingress.enabled .Values.ingress.hosts) }}{{ .Values.ingress.hosts | first }}{{ else }}''{{ end }}"
root_url: http://localhost:3000/grafana
serve_from_sub_path: true
I also tried using root_url: root_url: "%(protocol)s://%(domain)s/grafana"
.
I have a feeling this is caused by the host key in the values.yml file.
Or is the value I entered for root_url wrong?
2
Answers
I could fix the problem by setting
So the problem was the hosts tag, but I don't understand why it causes this problem. Does somebody know?
I am having the exact same issue. Would it be possible for you to post the output of
$ helm show values grafana/grafana
I have been struggling to get this working for several days and could really use the sanity check. I can also get this working with no issues via NodePort but I really just want it to show up at https://mysite.io/grafana where mysite.com is a public domain name and the root (https://mysite.io/) just points to another nginx service hosting a simple static page… which also works. So I know my ingress controller is setup correctly… Also I noticed that when I navigate to the page… I.E. mysite.io/grafana it will redirect me to mysite.io/login and give me the 404. This looks to me like its actually seeing the service…?