下载:
https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
comments.yaml文件修改:
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#新增
如果不新增会报错:
Error from server (ServiceUnavailable): the server is currently unable to handle the request (get pods.metrics.k8s.io)
手动打入镜像包:
docker save -o metrics-server.tar k8s.gcr.io/metrics-server/metrics-server
ctr -n=k8s.io image import metrics-server.tar
kubectl apply -f components.yaml