giantswarm/prometheus

how to set grafana path prefix?

ggaaooppeenngg opened this issue · 2 comments

the default prefix is "/", but I want to dispatch ingress to a sub path, I want all urls follow "prefix/" , can I set a url prefix for grafana?

  1. pass env var to grafana deployment:
- name: GF_SERVER_ROOT_URL
  value: https://url/subpath/
  1. ingress with the trailing "/" in path config
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: grafana
  namespace: monitoring
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  tls:
  - hosts:
    - url
    secretName: url-tls
  rules:
  - host: url
    http:
      paths:
      - path: /subpath/
        backend:
          serviceName: grafana
          servicePort: 3000`

This works for me!

@ggaaooppeenngg Has you tried mikes suggestion?