Kubernetes 1.17 部署 metrics-server 出现 no metrics known for node

在本地虚拟机 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 参数,就会出现    x509  x509  x509 问题 验证问题

E0309 13:57:53.055401       1 manager.go:111] unable to fully collect metrics: [unable to fully scrape metrics from source kubelet_summary:k8s-master: unable to fetch metrics from Kubelet k8s-master (192.168.17.150): Get https://192.168.17.150:10250/stats/summary?only_cpu_and_memory=true: x509: cannot validate certificate for 192.168.17.150 because it doesn't contain any IP SANs, unable to fully scrape metrics from source kubelet_summary:k8s-node01: unable to fetch metrics from Kubelet k8s-node01 (192.168.17.151): Get https://192.168.17.151:10250/stats/summary?only_cpu_and_memory=true: x509: cannot validate certificate for 192.168.17.151 because it doesn't contain any IP SANs, unable to fully scrape metrics from source kubelet_summary:k8s-node02: unable to fetch metrics from Kubelet k8s-node02 (192.168.17.152): Get https://192.168.17.152:10250/stats/summary?only_cpu_and_memory=true: x509: cannot validate certificate for 192.168.17.152 because it doesn't contain any IP SANs]
 

添加这两个参数后就能正常运行

执行 kubectl top nodes  操作命令后,如果出现只存在某个节点的资源使用情况,请考虑你在 kubedam init 时是否指定了正确的 --pod-network-cidr  与  --service-cidr  参数,calico 似乎好像不能跟物理机网络冲突。

有效的方法是去 https://github.com/kubernetes-sigs/metrics-server/ 官方 issue 或者 pull 中搜索。

发布了24 篇原创文章 · 获赞 36 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/tanjunchen/article/details/104762428