<p>I use minikube to run a local kubernetes cluster. I deploy grafana using helm from this repo: <a href="https://grafana.github.io/helm-charts" rel="nofollow noreferrer">https://grafana.github.io/helm-charts</a>. If I use port-forwarding it is perfectly accessible, so I tried to setup an ingress on chart-example.local/grafana. When I curl <code>chart-example.local/grafana</code> it works as well. but when I use <code>minnikube tunnel</code> and <code>localhost/grafana</code> in my browser I get <code>404 Not Found nginx</code>.</p>
<p>I made the following changes to the helm values file:</p>
<p><code>custom-values.yml</code>:</p>
<pre><code>ingress:
  enabled: true
  annotations: 
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /$1
    nginx.ingress.kubernetes.io/use-regex: &quot;true&quot;
  path: /grafana/?(.*)
  pathType: Prefix
  hosts:
   - chart-example.local

grafana.ini:
  server:
    domain: &quot;{{ if (and .Values.ingress.enabled .Values.ingress.hosts) }}{{ .Values.ingress.hosts | first }}{{ else }}''{{ end }}&quot;
    root_url: http://localhost:3000/grafana
    serve_from_sub_path: true
</code></pre>
<p>I also tried using root_url: <code>root_url: &quot;%(protocol)s://%(domain)s/grafana&quot;</code>.</p>
<p>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?</p>

Cake
<p>I could fix the problem by setting</p>
<pre><code>ingress: 
 - hosts: &quot;&quot;
</code></pre>
<p>So the problem was the hosts tag, but I don't understand why it causes this problem. Does somebody know?</p>
