gpt4 book ai didi

kubernetes - 无法获取 Grafana helm-charts URL 以使用子路径

转载 作者:行者123 更新时间:2023-12-02 12:04:23 29 4
gpt4 key购买 nike

我正在使用 helm-charts 在本地 kube 集群上设置 Grafana 服务器。我试图让它在子路径上工作,以便稍后在使用 tls 的生产环境中实现它,但我无法在 http://localhost:3000/grafana 上访问 Grafana .

我已经尝试了互联网上关于向入口添加子路径的所有建议,但似乎没有任何效果。

Grafana 登录屏幕显示在 http://localhost:3000/ 上当我删除 root_url 时:http://localhost:3000/grafana来自 Values.yaml

但是当我添加 root_url 时:http://localhost:3000/grafana回到 values.yaml 文件,我看到下面附加的错误(接近这篇文章的结尾)。

root_url: http://localhost:3000/grafana and ingress as:
ingress:
enabled: true
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /

labels: {}
path: /grafana
hosts:
- localhost
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

resources: {}

我希望 http://localhost:3000/grafana显示登录屏幕的 url 而不是我看到以下错误:

If you're seeing this Grafana has failed to load its application files 

1. This could be caused by your reverse proxy settings.

2. If you host grafana under subpath make sure your grafana.ini root_url setting includes subpath

3. If you have a local dev build make sure you build frontend using: yarn start, yarn start:hot, or yarn build

4. Sometimes restarting grafana-server can help

你能帮我修复 values.yaml 上的 ingress 和 root_url 以使 Grafana URL 在/grafana 工作吗?

最佳答案

当您检查 Configuring grafana behind Proxy 的文档时, root_url 应该在 [server] 部分下的 grafana.ini 文件中配置。您可以修改 values.yaml 来实现此目的。

grafana.ini:
...
server:
root_url: http://localhost:3000/grafana/

此外,您的值入口应如下所示。

ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /
labels: {}
path: /grafana/
hosts:
- ""

希望对您有所帮助。

关于kubernetes - 无法获取 Grafana helm-charts URL 以使用子路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56010759/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com