wget https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.6.1/components.yaml
修改镜像
command中增加--kubelet-insecure-tls
关闭证书认证
spec:
containers:
- args:
- --cert-dir=/tmp
- --secure-port=4443
- --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
- --kubelet-use-node-status-port
- --metric-resolution=15s
- --kubelet-insecure-tls
image: k8s-gcr.m.daocloud.io/metrics-server/metrics-server:v0.6.1
[root@master1 ~]# kubectl top node
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
master1 784m 20% 2040Mi 61%
master2 792m 20% 2155Mi 65%
master3 896m 23% 2242Mi 67%
node1 658m 16% 1962Mi 35%
node2 362m 9% 2310Mi 41%
node3 764m 19% 2191Mi 39%