kube-prometheus icon indicating copy to clipboard operation
kube-prometheus copied to clipboard

Root context-path for Prometheus, Grafana, Metrics, and Alert Manager URLs

Open cnukwas opened this issue 4 years ago • 5 comments

I have installed below kube-prometheus-stack and trying to see if it's possible to configure a context-path or context-root for all features available in Promotheous, Grafana, Metrics, and Alert Manager URLs/Dashboards.

Chart: kube-prometheus-stack-9.4.5 App Version: 0.38.1

I am able to access graphs at https://MyIngressURL/graph or https://MyIngressURL/config or https://MyIngressURL/status. I see similar set up for Grafana that I could access as https://MyIngressURL:80/. Is there a way to set up a root context path for each of these pods/charts configuration, so that I will be able to access all the features under https://MyIngressURL/monitoring/graph or https://MyIngressURL/monitoring/status or https://MyIngressURL/monitoring/metrics?

This would help me to use a single URL with different path prefixes configured for different services in Promotheus-stack Ingress URLs set up. Otherwise, I would have to configure 4 different URLs and distribute the same to Dev team, which doesn't look right.

Please correct me if I am missing something here as I couldn't find anything when searched for context-root or context-path.

Promotheus Grafana Alerts Manager Kube-state-Metrics

Thanks

cnukwas avatar Oct 05 '20 18:10 cnukwas

I think this is useful as an addon. We don't currently have this, as we leave this up to the user to decide, but I think this would be a useful addition as an opt-in choice by users. Do you want to try and contribute this? :)

brancz avatar Oct 07 '20 08:10 brancz

I think this is useful as an addon. We don't currently have this, as we leave this up to the user to decide, but I think this would be a useful addition as an opt-in choice by users. Do you want to try and contribute this? :)

Thanks, sure I am open to explore and learn, post details on where and how to get started and will give a try in our environment. On a side note, I have configured 4 different URLs for each of the pods/services below.

Promotheus Grafana Alerts Manager Kube-state-Metrics

cnukwas avatar Oct 07 '20 14:10 cnukwas

Looking at Grafana's docs for custom context-path, it doesn't look like that it is possible to set this up with environment variables passed to the container...

Any suggestions on how to tackle this issue?


Edit: nevermind, just found this: https://grafana.com/docs/grafana/latest/administration/configuration/#configure-with-environment-variables

ArthurSens avatar Mar 09 '21 20:03 ArthurSens

Looking at Grafana's docs for custom context-path, it doesn't look like that it is possible to set this up with environment variables passed to the container...

Any suggestions on how to tackle this issue?

Edit: nevermind, just found this: https://grafana.com/docs/grafana/latest/administration/configuration/#configure-with-environment-variables

Hi, have you solved this problem? I configured grafana deployment with following env

- env:
  - name: SERVER_ROOT_URL
    value: http://{my_lb_ip}/grafana
  - name: SERVER_SERVE_FROM_SUB_PATH
    value: "true"

and restart the deployment with no luck, pages still go to http://{my_lb_ip} (like http://{my_lb_ip}/login)


Edit: it seems that I missed the "GF_" prefix, and it's working now.

edwardzjl avatar Aug 18 '21 11:08 edwardzjl

@edwardzjl Similar to Grafana, is there any configuration available for Prometheus?

helloworld466 avatar Mar 01 '22 14:03 helloworld466