zhaobei / Question-bank

此项目记录了日常遇到的问题与解决问题的过程
MIT License
0 stars 0 forks source link

Kubernetes 1.16 部署 metrics-server 出现 no metrics known for node #5

Open zhaobei opened 2 years ago

zhaobei commented 2 years ago

在本地虚拟机 vmware 用 kubeadm 搭建的集群中部署 metrics-server 出现以下问题,我记录下。

ubelet k8s-node01 (k8s-node01): Get https://k8s-node01:10250/stats/summary?only_cpu_and_memory=true: dial tcp: lookup k8s-node01 on 10.32.0.10:53: no such host, unable to fully scrape metrics from source kubelet_summary:k8s-master: unable to fetch metrics from Kubelet k8s-master (k8s-master): Get https://k8s-master:10250/stats/summary?only_cpu_and_memory=true: dial tcp: lookup k8s-master on 10.32.0.10:53: no such host, unable to fully scrape metrics from source kubelet_summary:k8s-node02: unable to fetch metrics from Kubelet k8s-node02 (k8s-node02): Get https://k8s-node02:10250/stats/summary?only_cpu_and_memory=true: dial tcp: lookup k8s-node02 on 10.32.0.10:53: no such host]
E0309 13:51:03.487103       1 reststorage.go:135] unable to fetch node metrics for node "k8s-master": no metrics known for node
E0309 13:51:03.487648       1 reststorage.go:135] unable to fetch node metrics for node "k8s-node01": no metrics known for node
E0309 13:51:03.487759       1 reststorage.go:135] unable to fetch node metrics for node "k8s-node02": no metrics known for node

解决: metrics-server-deployment.yaml 添加 - --kubelet-preferred-address-types=InternalIP - --kubelet-insecure-tls 参数