我們正在使用 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"
完成此操作后,我會收到以下訊息:可以通過集群內以下 DNS 名稱上的埠 80 訪問 Prometheus 服務器:
我的 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: true
Grafana 也啟動了,但是當在這種情況下為 prometheus 的默認資料源無法提取任何資料時,當我檢查 Grafana 上的資料源選項卡并嘗試測驗資料源時,我收到錯誤讀取 Prometheus:client_error:客戶端錯誤: 404
因為這兩個部署都在同一個集群上,理想情況下它應該能夠訪問它。這里的任何幫助將不勝感激。
uj5u.com熱心網友回復:
這是因為您定位到了錯誤的服務。您正在使用警報管理器 url 而不是普羅米修斯服務器。
URL 應該是這個:
url: http://prometheus-server.prometheus.svc.cluster.local
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/432955.html
標籤:Kubernetes 普罗米修斯 格拉法纳 亚马逊-eks
下一篇:在SpringBoot中將KubernetesConfigMap值獲取到application.properties
