k8s集群报错

1.内存不够

报错信息

May  7 04:02:26 k8smaster containerd: time="2022-05-07T04:02:26.763885030+08:00" level=error msg="copy shim log" error="read /proc/self/fd/27: file already closed"

初步怀疑是内存出现问题

free -h

脚本检查后发现
总共内存:251G
使用内存:169G
剩余内存:1.4G
内存剩余:0.55
内存使用:67.48

内存剩余不多了
清理内存

sync 			#先把内存中的数据进行读写到磁盘中,多执行几次
echo 3 > /proc/sys/vm/drop_caches 		#释放内存
              total        used        free      shared  buff/cache   available
Mem:           251G        168G         78G        4.0G        4.7G         77G
Swap:            0B          0B          0B

2.租约报错

Apr 27 21:43:40 k8smaster kubelet: E0427 21:43:40.133068  113941 kubelet.go:2291] "Error getting node" err="node \"k8smaster\" not found"
Apr 27 21:43:40 k8smaster kubelet: I0427 21:43:40.155698  113941 kubelet_node_status.go:71] "Attempting to register node" node="k8smaster"
Apr 27 21:43:40 k8smaster dockerd: time="2022-04-27T21:43:40.161099645+08:00" level=error msg="Not continuing with pull after error: error creating lease: context canceled"
Apr 27 21:43:40 k8smaster kubelet: I0427 21:43:40.172788  113941 docker_sandbox.go:401] "Failed to read pod IP from plugin/docker" err="networkPlugin cni failed on the status hook for pod \"dashboard-metrics-scraper-856586f554-2hx4f_kubernetes-dashboard\": CNI failed to retrieve network namespace path: cannot find network namespace for the terminated container \"34bf60d655f5addca7e579bcf1869b817e8c49d34ccfb978af7f16d2d1c0bff6\""
Apr 27 21:43:40 k8smaster kubelet: I0427 21:43:40.176984  113941 docker_sandbox.go:401] "Failed to read pod IP from plugin/docker" err="networkPlugin cni failed on the status hook for pod \"dashboard-metrics-scraper-856586f554-2hx4f_kubernetes-dashboard\": CNI failed to retrieve network namespace path: cannot find network namespace for the terminated container \"d1b953f31241261e4c469a52763af5663c508a62134f462d643558a484bf33d3\""
Apr 27 21:43:40 k8smaster kubelet: I0427 21:43:40.227094  113941 docker_sandbox.go:401] "Failed to read pod IP from plugin/docker" err="networkPlugin cni failed on the status hook for pod \"coredns-558bd4d5db-4j8nv_kube-system\": CNI failed to retrieve network namespace path: cannot find network namespace for the terminated container \"3213f8a980cd0eb599b12248033c46e5c227180a30f986cda94af0acff6d5467\""
Apr 27 21:43:40 k8smaster kubelet: I0427 21:43:40.229381  113941 docker_sandbox.go:401] "Failed to read pod IP from plugin/docker" err="networkPlugin cni failed on the status hook for pod \"coredns-558bd4d5db-4j8nv_kube-system\": CNI failed to retrieve network namespace path: cannot find network namespace for the terminated container \"b1b9a57d7ebe974fd71dbe86e3271aaa75cac6e513d82135a5e5f1df4201f090\""
Apr 27 21:43:40 k8smaster kubelet: E0427 21:43:40.233426  113941 kubelet.go:2291] "Error getting node" err="node \"k8smaster\" not found"
Apr 27 21:43:40 k8smaster kubelet: I0427 21:43:40.249893  113941 scope.go:111] "RemoveContainer" containerID="e6e7eb170618af3591f6fc3f40c2f7c3776d21954acfe19a043b4c3eff2d25ad"
Apr 27 21:43:40 k8smaster kubelet: I0427 21:43:40.265341  113941 docker_sandbox.go:401] "Failed to read pod IP from plugin/docker" err="networkPlugin cni failed on the status hook for pod \"kubernetes-dashboard-67484c44f6-7zgwn_kubernetes-dashboard\": CNI failed to retrieve network namespace path: cannot find network namespace for the terminated container \"905002a60acbffdadb87782f568faaa7cb05c30477a0b96f14f14f3b25406ead\""
Apr 27 21:43:40 k8smaster kubelet: I0427 21:43:40.267796  113941 docker_sandbox.go:401] "Failed to read pod IP from plugin/docker" err="networkPlugin cni failed on the status hook for pod \"kubernetes-dashboard-67484c44f6-7zgwn_kubernetes-dashboard\": CNI failed to retrieve network namespace path: cannot find network namespace for the terminated container \"f8666efdd85e7de0ddb9ae3fcb0491aa9c03b8562a8582962c9e41e053602200\""
Apr 27 21:43:40 k8smaster kubelet: I0427 21:43:40.287029  113941 docker_sandbox.go:401] "Failed to read pod IP from plugin/docker" err="networkPlugin cni failed on the status hook for pod \"coredns-558bd4d5db-fl9lp_kube-system\": CNI failed to retrieve network namespace path: cannot find network namespace for the terminated container \"70915cac633ade99a6ac1575dd97ccb2b9cae5d9c1a199e0d31d7331a75fb0c9\""
Apr 27 21:43:40 k8smaster kubelet: I0427 21:43:40.289279  113941 docker_sandbox.go:401] "Failed to read pod IP from plugin/docker" err="networkPlugin cni failed on the status hook for pod \"coredns-558bd4d5db-fl9lp_kube-system\": CNI failed to retrieve network namespace path: cannot find network namespace for the terminated container \"ce361c6004713dbc9bf88d2e0ede746799ecf484e1561e0e7dee6639e5a6cdd3\""

主要的报错解释第三行
进行k8s的租约更
注:更新前把以前的证书进行备份

cd /etc/kubernetes/
cp -rapf pki k8szs.bak
kubeadm certs renew all
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值