Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enforce_domain breaks quay.io/kiwigrid/k8s-sidecar reloading #3330

Open
brianbraunstein opened this issue Sep 25, 2024 · 1 comment
Open

Comments

@brianbraunstein
Copy link

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:

- name: REQ_URL
value: {{ .Values.sidecar.alerts.reloadURL }}

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.

@brianbraunstein
Copy link
Author

I looked into fixing quay.io/kiwigrid/k8s-sidecar but actually I think it's fine. The problem is the grafana server is returning a 301 when it should return a 308. I update the grafana issue grafana/grafana#93773 with more details about this. That means there are 2 alternatives, both described in grafana/grafana#93773

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant