kubernetes - Grafana 为 Prometheus 数据源抛出 HTTP Error Bad Gateway
问题描述
我在我的 k8s 集群上设置了 Grafana 和 Prometheus。两者都是使用https://github.com/helm/charts/tree/master/stable通过 helm 安装的。Grafana 和 Prometheus 都是通过我的 domian 地址通过 k8s nginx 入口设置的。当我尝试在 Grafana 中将 Prometheus 设置为数据源时,我得到HTTP Error Bad Gateway
. 在 Grafana 页面的 chrome 控制台中,我看到:
http://grafana.domain.com/api/datasources/proxy/1/api/v1/query?query=1%2B1&time=1554043210.447
Grafana version: Grafana v6.0.0 (commit: 34a9a62)
Prometheus 的 Grafana 数据源设置:
URL: https://prometheus.mydomain.com:9090
Access: Server(Default)
Auth:
Basic & TLS Client Auth
可能有什么问题以及如何调试/修复它?
解决方案
在 prometheus 数据库的 Grafana 数据源设置中,添加 prometheus 服务 dns 和服务端口。像下面
<prometheus service name>. Namespace. Svc. Cluster. Local:9090
推荐阅读
- c# - 每次不使用创建不同的数据库上下文有什么问题吗
- java - 检查流的所有对象是否符合规则
- elasticsearch - 嵌套对象中的脚本字段,特别是 geo_shapes
- c++ - 该程序不返回任何内容
- java - 如何在 VS Code 中为 Java 启用语法高亮
- kubernetes - Kubernetes nginx 入口重写问题
- c# - 在构造函数中启动任务是否有问题?
- sql - DB2 BLOB 如何做 MD5?
- html - 在 Web 浏览器 MFC 中打开新窗口时如何获取新网页的 URL
- java - 尝试在 WSO2 身份服务器中创建 ServiceProvider 时出现 ArrayIndexOutOfBoundsException