Description
Problem
Turning on enforce_domain
https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#enforce_domain forces a redirect even of the localhost API calls done by the sidecars quay.io/kiwigrid/k8s-sidecar . It looks like when quay.io/kiwigrid/k8s-sidecar gets the redirect, it switches from POST to GET, at which point the request fails. Setting reloadURL
manually is a workaround.
Suggestion
When setting enforce_domain
, then default reloadURL
to use root_url
https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#root_url instead of localhost. Which will involve some tweaking here:
helm-charts/charts/grafana/templates/_pod.tpl
Lines 386 to 387 in 79ab1d5
Alternatives
I also filed grafana/grafana#93773 to try to make enforce_domain
NOT redirect localhost (or have an additional option to do this) which would avoid the need to fix this.
Fixing quay.io/kiwigrid/k8s-sidecar to handle redirects is another option.