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 中搜索。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章