Skip to content

Commit

Permalink
kubelet 10250 monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
cnych committed Sep 30, 2019
1 parent 5e0ed8e commit 826ef0b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/54.监控Kubernetes集群节点.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,22 @@ Get http://10.151.30.57:10250/metrics: net/http: HTTP/1.x transport connection b
regex: __meta_kubernetes_node_label_(.+)
```

**特别需要注意**的是 Kubernetes 1.11+ 版本以后,kubelet 就移除了 10255 端口, metrics 接口又回到了 10250 端口中,所以这里不需要替换端口,但是需要使用 https 的协议。所以如果你使用的是 Kubernetes 1.11+ 版本的化,需要讲上面的 `kubernetes-kubelet` 任务替换成下面的配置:

```yaml
- job_name: 'kubernetes-kubelet'
kubernetes_sd_configs:
- role: node
scheme: https
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
relabel_configs:
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
```

现在我们再去更新下配置文件,执行 reload 操作,让配置生效,然后访问 Prometheus 的 Dashboard 查看 Targets 路径:

![prometheus node targets](./images/prometheus-nodes-target2.png)
Expand Down

0 comments on commit 826ef0b

Please sign in to comment.