Grafana HTTP错误错误网关和模板初始化失败错误

问题描述 投票:5回答:1

使用helmPrometheus本地安装了Grafanaminikube

$ helm install stable/prometheus
$ helm install stable/grafana

Prometheus服务器,alertmanager grafana可以在设置端口转发后运行:

$ export POD_NAME=$(kubectl get pods --namespace default -l "app=prometheus,component=server" -o jsonpath="{.items[0].metadata.name}")
$ kubectl --namespace default port-forward $POD_NAME 9090

$ export POD_NAME=$(kubectl get pods --namespace default -l "app=prometheus,component=alertmanager" -o jsonpath="{.items[0].metadata.name}")
$ kubectl --namespace default port-forward $POD_NAME 9093

$ export POD_NAME=$(kubectl get pods --namespace default -l "app=excited-crocodile-grafana,component=grafana" -o jsonpath="{.items[0].metadata.name}")
$ kubectl --namespace default port-forward $POD_NAME 3000

enter image description here enter image description here

从grafana添加数据源,得到HTTP Error Bad Gateway错误:

enter image description here

从以下位置导入仪表板315:

https://grafana.com/dashboards/315

然后查看qazxsw poi,获取qazxsw poi错误:

Kubernetes cluster monitoring (via Prometheus)

为什么?

kubernetes monitoring grafana prometheus minikube
1个回答
11
投票

在Grafana的HTTP设置中,您将Templating init failed设置为enter image description here,这意味着Grafana想要访问Prometheus。由于Kubernetes使用覆盖网络,因此它是一个不同的IP。

有两种方法可以解决这个问题:

  1. Access设置为Proxy,以便浏览器直接连接到Prometheus。
  2. 使用Kubernetes内部IP或域名。我不知道普罗米修斯头盔图,但假设有一个名为AccessDirect,像Service这样的东西应该有效。
© www.soinside.com 2019 - 2024. All rights reserved.