【发布时间】:2020-08-19 12:48:09
【问题描述】:
我在 GKE 上的另一个端口 (11100) 上运行节点导出器,并将 prometheus.yml 配置为使用 kubernetes_sd_configs。但是,服务发现似乎正在返回具有 Kubelet 端口 (10250) <node-ip>:10250/metrics 的节点 IP。我似乎找不到指定使用哪个端口的方法。有什么想法吗?
- job_name: gke-nodes
kubernetes_sd_configs:
- role: node
另外,node-exporter 在端口11100 中运行正常。我通过在内部节点 IP <node-ip>:11100/metrics 中执行 curl 来验证它,它就像一个魅力
这是我的节点导出器定义
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: node-exporter-ds
namespace: monitoring
labels:
app: node-exporter
belongsTo: monitoring
spec:
selector:
matchLabels:
app: node-exporter
template:
metadata:
labels:
app: node-exporter
spec:
serviceAccountName: monitoring-sa
volumes:
- name: proc
hostPath:
path: /proc
- name: sys
hostPath:
path: /sys
containers:
- name: node-exporter
image: prom/node-exporter:v0.18.1
args:
- "--web.listen-address=0.0.0.0:11100"
- "--path.procfs=/proc_host"
- "--path.sysfs=/host_sys"
ports:
- containerPort: 11100
hostPort: 11100
volumeMounts:
- name: sys
readOnly: true
mountPath: /host_sys
- name: proc
readOnly: true
mountPath: /proc_host
imagePullPolicy: IfNotPresent
hostNetwork: true
hostPID: true
【问题讨论】:
-
你是如何设置 prometheus/node 导出器的?
-
我将在问题中更新它,以便向您展示我的节点导出器定义
-
能分享一下prometheus/node exporter的错误信息和日志吗?
标签: google-kubernetes-engine prometheus prometheus-node-exporter