安装 metrics-server
wget https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
替换image
image: registry.aliyuncs.com/google_containers/metrics-server:v0.6.0
imagePullPolicy: IfNotPresent
args:
// 新增下面两行参数
- --kubelet-insecure-tls
- --kubelet-preferred-address-types=InternalDNS,InternalIP,ExternalDNS,ExternalIP,Hostname
部署
kubectl create -f components.yaml
查看pod是否运行
kubectl get pods -n kube-system
NAME READY STATUS RESTARTS AGE
metrics-server-6c77ddc6d7-87wfk 1/1 Running 0 74s