k8s 之安装metrics-server

作者:程序那点事儿 日期:2024/01/29 18:25


metrics-server可帮助我们查看pod的cpu和内存占用情况

kubectl top po nginx-deploy-56696fbb5-mzsgg # 报错,需要Metrics API

下载 Metrics 解决

wget https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml -O metrics-server-components.yaml

如果连不上github:访问或下载github资源连接不上

替换镜像加速地址

sed -i 's/registry.k8s.io\/metrics-server/registry.aliyuncs.com\/google_containers/g' metrics-server-components.yaml

打开文件,在containers:agrs下添加一个配置,意思是不做tls证书校验

--kubelet-insecure-tls

安装

kubectl apply -f metrics-server-components.yaml

查看一下

kubectl get po --all-namespaces | grep metrics

再次查看pod,可以发现多出两列,分别是cpu和内存的占用情况

相关推荐
等什么君!1 小时前
docker -数据卷技术
运维·docker·容器
花酒锄作田2 小时前
Debian 13基于kubeadm和containerd部署单节点kubernetes
kubernetes·containerd·cilium
上天_去_做颗惺星 EVE_BLUE2 小时前
Docker高效使用指南:从基础到实战模板
开发语言·ubuntu·docker·容器·mac·虚拟环境
Gary董3 小时前
高并发的微服务架构如何设计
微服务·云原生·架构
东哥爱编程3 小时前
使用Runpod进行gpu serverless推理
云原生·serverless
好好沉淀4 小时前
Docker开发笔记(详解)
运维·docker·容器
Ankie Wan5 小时前
cgroup(Control Group)是 Linux 内核提供的一种机制,用来“控制、限制、隔离、统计”进程对系统资源的使用。
linux·容器·cgroup·lxc
lcx_defender6 小时前
【Docker】Docker部署运行nacos
运维·docker·容器
啦啦啦小石头7 小时前
docker添加用户权限不使用sudo
运维·docker·容器
天才奇男子8 小时前
《深度解析HAProxy七层代理:原理、配置与最佳实践》
linux·运维·微服务·云原生