kubernetes 1.15安装部署metrics-server插件v0.3.6
正常部署后查看日志有报错 manager.go:111] unable to fully collect metrics: [unable to fully scrape metrics from source kubelet_summary:node1: unable to fetch metrics from Kubelet node1 (node1): Get https://node1:10250/stats/summary?only_cpu_and_memory=true: dial tcp: lookup node1 on 10.96.0.10:53: no such host, unable to fully scrape metrics from source kubelet_summary:node2: unable to fetch metrics from Kubelet node2 (node2): Get https://node2:10250/stats/summary?only_cpu_and_memory=true: dial tcp: lookup node2 on 10.96.0.10:53: no such host, unable to fully scrape metrics from source kubelet_summary:master: unable to fetch metrics from Kubelet master (master): Get https://master:10250/stats/summary?only_cpu_and_memory=true: dial tcp: lookup master on 10.96.0.10:53: no such host]
默认的deploy文件有坑,需要修改metrics-server-deployment.yaml (添加command红色部分)
containers: 31 - name: metrics-server 32 image: registry.cn-hangzhou.aliyuncs.com/centosos/metrics-server-amd64:v0.3.6 33 imagePullPolicy: IfNotPresent 34 args: 35 - --cert-dir=/tmp 36 - --secure-port=4443 37 command: 38 - /metrics-server 39 - --kubelet-preferred-address-types=InternalIP 40 - --kubelet-insecure-tls 41 ports: 42 - name: main-port 43 containerPort: 4443 44 protocol: TCP 45 securityContext: 46 readOnlyRootFilesystem: true 47 runAsNonRoot: true 48 runAsUser: 100