关于 Linux netns 提问

2022-05-18 15:20:55 +08:00
 amrom

请教一下各位老哥:

问题:最近起 pod 的时候,node2 节点总是有个报错,Failed to create pod sandbox: rpc error: code = Unknown desc = failed to create network namespace for sandbox "4cad3042edd303047a78929609ab6fc5cc5ca72f1f29650cbf71d28d4d27b112": failed to setup netns: failed to create namespace: cannot allocate memory,隔一段时间后,pod 也能正常跑起来,问题定位不出来,勉强定位出来一个可能的问题,在 nde2 节点检查 net ns 的时候,发现好多 ns ,可能是 pod 删除后没清理的

[root@node2 ~]# ip netns ls 
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
...
RTNETLINK answers: Invalid argument
cni-2f4b92c9-a224-c0e5-c89d-2e40aaf8cb73
RTNETLINK answers: Invalid argument
cni-443554aa-edb7-c421-8f8c-e31e5c6cfa5e
RTNETLINK answers: Invalid argument
cni-68e105fe-1096-bcc4-d279-923136e53805
cni-15381e7a-c89e-f2fc-65ae-b7e761b0e9f9 (id: 5)
cni-f738af18-e870-193e-ca0c-e0f2f7e07c81 (id: 8)

问题:首先就是我定位的地方对不对,还有就是这些 ns 怎么清理比较好,google 了一圈,有让升级 cni 插件的,有让升级 kernel 的,但是没有详细的

其他:cni 用的 calico ,centos 内核3.10.0-1062.el7.x86_64

有没有遇到过类似问题的朋友,帮忙提点下

1547 次点击
所在节点    Kubernetes
2 条回复
idblife
2022-05-18 17:29:22 +08:00
不看具体问题,请首先升级内核
Nitroethane
2022-05-18 18:03:52 +08:00
k8s 什么版本?用 3.10 内核跑。k8s 怕是老了点

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/853722

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX