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 似乎好像不能跟物理机网络冲突。

有效的方法是去 GitHub - kubernetes-sigs/metrics-server: Scalable and efficient source of container resource metrics for Kubernetes built-in autoscaling pipelines. 官方 issue 或者 pull 中搜索。

如何参与 CNCF 的 Kubernetes 项目呢? GitHub - tanjunchen/participate-community: 如何参加 CNCF 等开源社区呢?如何向 Kubernetes 等开源仓库提交贡献呢?这里提供一些信息

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

远方的飞猪

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值