Moses
Moses

Reputation: 711

Grafana UI does not load when deployed through helm chart

I am trying to deploy the kube-prometheus-stack.

I have added it as a dependency in the Chart.yaml as below.

...
dependencies:
  - name: kube-prometheus-stack
    version: 13.4.1
    repository: https://prometheus-community.github.io/helm-charts
...

I have also configured an ingress rule to route the /grafana/?(.*) path to the service solutions-helm-grafana at port 80.

- path: /grafana/?(.*)
  pathType: Prefix
  backend:
    service:
      name: helm-grafana
      port:
        number: 80

However, when I try open /grafana/ in the browser, it returns a 404 after redirecting to /login. What templates do I need to add to successfully deploy ? Are there any examples that I can refer to ?

Upvotes: 0

Views: 1242

Answers (1)

rohatgisanat
rohatgisanat

Reputation: 828

Hi @Moses can you try removing the ?(.*) from the path?

404 comes up when the ingress is not registered with the ingress controller.

Probably because the release has not been deployed successfully.

Try the following steps to debug the issue:-

  • Check if the pod have been deployed using kubectl get pods.
  • Try debugging the ingress object. kubectl describe ing <ing_object_name>.
  • Check if the Endpoints have been created using kubectl get ep.
  • Next,get the service endpoint using kubectl get service.
  • Use a busybox pod to curl and check whether the Grafana is being served via the service above.

Update:- Add the following configuration to serve Grafana on a subpath

env:
  GF_SERVER_DOMAIN: <domain>
  GF_SERVER_ROOT_URL: https://<domain>/grafana/
  GF_SERVER_SERVE_FROM_SUB_PATH: true

and use this path in ingress:

path: /grafana/

Sources: Run Grafana behind reverse-proxy Grafana confiugration root_url

Upvotes: 1

Related Questions