一、Installing Metrics Server on Kubernetes-1.25.2
链接:https://github.com/kubernetes-sigs/metrics-server
在新版的Kubernetes中系统资源的采集均使用Metrics-Server,可以通过Metrics采集节点和Pod的内存、磁盘、CPU和网络的使用率。
1 wget 下载
cd /opt/kubernetes/addons
wget https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.6.1/components.yaml
2 增加内容
vim /opt/kubernetes/addons/components.yaml
- --kubelet-insecure-tls
- --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.pem
- --requestheader-username-headers=X-Remote-User
- --requestheader-group-headers=X-Remote-Group
- --requestheader-extra-headers-prefix=X-Remote-Extra-
image: swr.cn-north-1.myhuaweicloud.com/huaxiayuyi/metrics-server:v0.6.1
- name: ca-ssl
mountPath: /etc/kubernetes/pki
- name: ca-ssl
hostPath:
path: /etc/kubernetes/pki
3 安装metrics server
kubectl apply -f /opt/kubernetes/addons/components.yaml
4 查看状态
kubectl top node
二、报错
此错误是 node 节点没有此证书
[root@kube-master01 ~]# kubectl logs metrics-server-ff8979984-l7rmb -n kube-system
Error: unable to create request header authentication config: open /opt/kubernetes/pki/front-proxy-ca.pem: no such file or directory
...
panic: unable to create request header authentication config: open /opt/kubernetes/pki/front-proxy-ca.pem: no such file or directory
goroutine 1 [running]:
main.main()
/go/src/sigs.k8s.io/metrics-server/cmd/metrics-server/metrics-server.go:37 +0xa5
# 解决
scp /opt/kubernetes/pki/front-proxy-ca.pem [email protected]:/opt/kubernetes/pki/
scp /opt/kubernetes/pki/front-proxy-ca.pem [email protected]:/opt/kubernetes/pki/
三、安装 Kubernetes-1.25.2
Kubernetes-1.25 Container Image Download:https://www.cnblogs.com/huaxiayuyi/p/16823613.html
Installing Kubernetes-1.25.2 on CentOS 7.9:https://www.cnblogs.com/huaxiayuyi/p/16816029.html
标签:opt,metrics,kubernetes,ca,Installing,server,Metrics,pki,1.25 From: https://www.cnblogs.com/huaxiayuyi/p/16824749.html