我们使用AWS EKS,我使用下面的命令部署Promethus:
kubectl create namespace prometheus
helm install prometheus prometheus-community/prometheus \
--namespace prometheus \
--set alertmanager.persistentVolume.storageClass="gp2" \
--set server.persistentVolume.storageClass="gp2"完成此操作后,我将收到以下消息: Prometheus服务器可以通过端口80从您的集群中访问以下DNS名称:
prometheus部署上的服务看起来像是打击:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/prometheus-alertmanager ClusterIP 10.22.210.131 <none> 80/TCP 20h
service/prometheus-kube-state-metrics ClusterIP 10.12.43.248 <none> 8080/TCP 20h
service/prometheus-node-exporter ClusterIP None <none> 9100/TCP 20h
service/prometheus-pushgateway ClusterIP 10.130.54.42 <none> 9091/TCP 20h
service/prometheus-server ClusterIP 10.90.94.70 <none> 80/TCP 20h我现在在Grafana上的数据源中使用这个URL作为:
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus-alertmanager.prometheus.svc.cluster.local
access: proxy
isDefault: trueGrafana也已启动,但是当默认数据源(在本例中为prometheus )无法提取任何数据时,当我在Grafana上的“数据源”选项卡中签入并尝试测试数据源时,我将错误地读取Prometheus: client_error: client error: 404。
由于这两个部署都位于同一个集群上,所以理想情况下,它应该能够访问这个集群。这里的任何帮助都将是非常感谢的。
发布于 2022-02-25 10:13:48
这是因为你的目标是错误的服务。您使用的是警报管理器url而不是prometheus服务器。
URL应该是这个:
url: http://prometheus-server.prometheus.svc.cluster.localhttps://stackoverflow.com/questions/71261619
复制相似问题