下载配置
cd ~/helm
mkdir metrics-server
cd metrics-server
helm repo add bitnami https://charts.bitnami.com/bitnami
helm pull bitnami/metrics-server
tar -zxvf metrics-server-5.9.2.tgz
rm metrics-server-5.9.2.tgz
vi metrics-server/values.yaml
# 修改
apiService:
create: true
extraArgs:
kubelet-insecure-tls: true
kubelet-preferred-address-types: InternalIP
# extraArgs: {}
...
extraVolumes:
## extraVolumeMounts:
## - name: tmpdir
## mountPath: /tmp
##
- hostPath:
path: /etc/localtime
type: ""
name: host-time
extraVolumeMounts:
## @param extraContainers Extra containers to run within the pod
##
- mountPath: etc/localtime
name: host-time
readOnly: true
安装
helm install metrics-server metrics-server
验证
kubectl get --raw "/apis/metrics.k8s.io/v1beta1/nodes"
kubectl top node