首页
k8s 安装metric server

安装

直接通过yaml安装即可

kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml

详细信息可参考官方说明:

https://github.com/kubernetes-sigs/metrics-server/blob/master/README.md

问题

  1. 镜像下载失败

使用国内源:registry.cn-hangzhou.aliyuncs.com/google_containers

    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: registry.cn-hangzhou.aliyuncs.com/google_containers/metrics-server:v0.6.4
        imagePullPolicy: IfNotPresent
  1. 遇到错误:metrics-server error because it doesn't contain any IP SANs

启动容器的命令增加参数--kubelet-insecure-tls

command:
- /metrics-server
- --kubelet-insecure-tls