I try to expose Grafana thanks to Nginx ingress and behind a url subpath. First I deploy the nginx ingress controller Helm chart (version ingress-nginx-4.3.0) I installed it with helm kube-prometheus-stack chart (version kube-prometheus-stack-41.7.3). I use this values.yaml file for the prometheus-stack chart installation:
grafana:
testFramework:
enabled: false
ingress:
enabled: true
annotations: {
kubernetes.io/ingress.class: nginx
}
hosts:
- "mydomain"
pathType: Prefix
path: /grafana
grafana.ini:
server:
domain: "mydomain"
root_url: "https://mydomain/grafana"
serve_from_sub_path: true
admin:
existingSecret: grafana-admin-credentials
serviceMonitor:
enabled: true
podDisruptionBudget:
minAvailable: 1
persistence:
enabled: true
storageClassName: default
alertmanager:
podDisruptionBudget:
enabled: true
prometheus:
podDisruptionBudget:
enabled: true
prometheusSpec:
storageSpec:
volumeClaimTemplate:
spec:
storageClassName: default
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 50Gi
kubeScheduler:
enabled: false
kubeControllerManager:
enabled: false
I meet an error page with some advices to load application files:
If you're seeing this Grafana has failed to load its application files
This could be caused by your reverse proxy settings.
If you host grafana under subpath make sure your grafana.ini root_url setting includes subpath. If not using a reverse proxy make sure to set serve_from_sub_path to true.
If you have a local dev build make sure you build frontend using: yarn start, yarn start:hot, or yarn build
Sometimes restarting grafana-server can help
Check if you are using a non-supported browser. For more information, refer to the list of supported browsers.
During my researches, I found this subject that seems to be the same issue but when I try to do the same configuration, it does not work: Trying to rewrite url for Grafana with Ingress
Did anyone ever meet this kind of issue and can explain me why the application can't load its application file please? Thanks in avance for your help