<h2>Context</h2>
<p>Say I have grafana exposed through the following <strong>ingress</strong></p>
<pre class="lang-yaml prettyprint-override"><code># Helm value file
grafana:
  ingress:
    enabled: true
    annotations: {}
    hosts:
      - host: chart-example.local
        paths: [&quot;/grafana/&quot;]
</code></pre>
<p>To overcome the <em>relative path issue</em> raised by this reverse proxy, I am using a useful mechanism I used several times: <a href="https://grafana.com/docs/grafana/latest/administration/configure-docker/" rel="nofollow noreferrer">grafana's docker image are entirely configurable with ENV VARS</a>. Following <a href="https://grafana.com/tutorials/run-grafana-behind-a-proxy/#1" rel="nofollow noreferrer">this doc</a>, I then wrote (not using variables yet):</p>
<pre class="lang-yaml prettyprint-override"><code>kind: Deployment
.....
      containers:
        - name: {{ .Chart.Name }}-grafana
          image: &quot;{{ .Values.grafana.image.repository }}:{{ .Values.grafana.image.tag | default .Chart.AppVersion }}&quot;
          env:
          - name: GF_SERVER_ROOT_URL
            value: http://chart-example.local/grafana/
          ports:
            - name: http
              containerPort: 3000
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /
              port: http
          readinessProbe:
            httpGet:
              path: /
              port: http
</code></pre>
<h2>Problem</h2>
<p>Now readiness probes fail</p>
<blockquote>
<p>Readiness probe failed: Get &quot;/grafana/login&quot;: stopped after 10 redirects Back-off restarting failed container</p>
</blockquote>
<p>I don't quite understand why. I tried to change <code>livenessProbe</code> and <code>readinessProbe</code>'s paths without much conviction: from the pod's stand point, routes are the same. I can for instance, with this configuration, access directly</p>
<pre class="lang-sh prettyprint-override"><code>http://${pods_ip}:3000/login
</code></pre>
<p>Why would it affect the <strong>probes</strong>?</p>

zar3bski
<p>Adding the following to <strong>grafana.ini</strong> <code>configMap</code> solved the probe issue</p>
<pre><code>[server]
serve_from_sub_path = true
</code></pre>
