- 安装metrics-server
- kubeadm默认安装是就安装了coredns
- 下载yaml文件
github的链接metrics-server
所有的yaml文件都需要下载到本地 - 应用
- 问题处理
- 连接node1报错,报错信息为manager.go:111] unable to fully collect metrics: [unable to fully scrape metrics from source kubelet_summary:node1: unable to fetch metrics from Kubelet node1 (node1): Get https://node1:10250/stats/summary?only_cpu_and_memory=true: dial tcp: lookup node1 on 10.96.0.10:53: no such host, unable to fully scrape metrics from source kubelet_summary:node2: unable to fetch metrics from Kubelet node2 (node2): Get https://node2:10250/stats/summary?only_cpu_and_memory=true: dial tcp: lookup node2 on 10.96.0.10:53: no such host]
该问题是服务器节点是自定义hosts,而不是dns,修改coredns的配置即可 - 认证失败,报错信息为unable to fully collect metrics: [unable to fully scrape metrics from source kubelet_summary:node2: unable to fetch metrics from Kubelet node2 (node2): Get https://node2:10250/stats/summary?only_cpu_and_memory=true: x509: certificate signed by unknown authority, unable to fully scrape metrics from source kubelet_summary:node1: unable to fetch metrics from Kubelet node1 (node1): Get https://node1:10250/stats/summary?only_cpu_and_memory=true: x509: certificate signed by unknown authority]