Skip to content

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

Open

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:

- 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions