k8s 监控程序Metric-server pod运行异常:出现
metrics-server error because it doesn't contain any IP SANs
查看 pod状态,pod 正在运行 但是pod状态不正常:
kubectl get pods -n kube-system
metrics-server-756b6bb44f-d5tgj 0/1 Running 0 11s
查看日志:
it doesn't contain any IP SANs" node="kubernetes-master"
it doesn't contain any IP SANs" node="node1
google搜索发现:
主要是通过 metric-server增加启动参数解决:
主要原因是:证书双向验证不通过,这个这里可以采取忽略处理
args:
- --cert-dir=/tmp
- --secure-port=4443
- --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
- --kubelet-use-node-status-port
- --kubelet-insecure-tls
对应deployment.yaml文件修改内容为:
containers:
- name: metrics-server
image: swr.cn-east-3.myhuaweicloud.com/hll-bigdata/metrics-server:v0.5.0
imagePullPolicy: IfNotPresent
args:
- --cert-dir=/tmp
- --secure-port=443
- --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
- --kubelet-use-node-status-port
- --metric-resolution=15s
- --kubelet-insecure-tls
再执行pod状态正常
kk get pods
metrics-server-756b6bb44f-d5tgj 1/1 Running 0 16m