We host Grafana instances as containers via Kubernetes - and on the whole it works really well.
Now someone’s asked me to spin up a private instance on a subpath and I just can’t get it working. The canonical URL is dat-grafana and the user wants to be able to access a beta-grafana Kubernetes service on a url of dat-grafana/beta.
So I’ve setup the Kubernetes ingress as follows:
rules: - host: dat-grafana http: paths: - path: / backend: serviceName: grafana servicePort: 3000 - path: /beta backend: serviceName: beta-grafana servicePort: 3000
And the beta-grafana is using the following setup:
[server] # Protocol (http, https, socket) protocol = http # The ip address to bind to, empty will bind to all interfaces ;http_addr = # The http port to use http_port = 3000 # The public facing domain name used to access grafana from a browser domain = dat-grafana # Redirect to correct domain if host header does not match domain # Prevents DNS rebinding attacks ;enforce_domain = false # The full public facing url you use in browser, used for redirects and emails # If you use reverse proxy and sub path specify full url (with sub path) root_url = http://dat-grafana/beta/
I’m using the latest container image (6.2.2) - which supposedly has the patch to get subpaths working - but the resulting setup just gives me 404 errors in the logs and the holding page with the messages about failed to find resources, the Grafana configuration being wrong, needing restarted etc.
Anyone who’s got it working care to point me at what I’ve done wrong?