Kubrnetes work NotReady ResourceExhausted work节点资源耗尽

rpc error: code = ResourceExhausted desc = grpc: received message larger than max (4196772 vs. 4194304)

现象:kubernetes集群不可用,所有work节点离线

问题定位:

执行kubectl get node 发现work节点都是NotReady状态
登入到work节点查看日志发现

Nov 1 10:32:34 izwz9a75ak59utsbrrj9crz kubelet: E1101 10:32:34.119157 1669 kuberuntime_container.go:323] getKubeletContainers failed: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (4196772 vs. 4194304)
Nov 1 10:32:34 izwz9a75ak59utsbrrj9crz kubelet: E1101 10:32:34.119174 1669 generic.go:197] GenericPLEG: Unable to retrieve pods: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (4196772 vs. 4194304)

发现/var/lib/docker/containers 下有上万个容器文件
[root@k8s-master-2 ~]# docker ps -a|wc -l
10180

该问题是有k8s的一个bug https://github.com/kubernetes/kubernetes/issues/63858

解决方法:

登入到work节点清除不用的容器残留
docker system prune

重启docker和kubelet

systemctl restart docker&&systemctl restart kubelet

k8s强制删除pods:
kubectl delete pods cloudagile-mariadb-0 -n intelligence-data-lab --grace-period=0 --force

转自:https://blog.csdn.net/u011181610/article/details/83623286

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值