V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
amrom
V2EX  ›  Kubernetes

关于 Linux netns 提问

  •  
  •   amrom · 2022-05-18 15:20:55 +08:00 · 1500 次点击
    这是一个创建于 681 天前的主题,其中的信息可能已经有所发展或是发生改变。

    请教一下各位老哥:

    问题:最近起 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

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

    2 条回复    2022-05-18 18:03:52 +08:00
    idblife
        1
    idblife  
       2022-05-18 17:29:22 +08:00
    不看具体问题,请首先升级内核
    Nitroethane
        2
    Nitroethane  
       2022-05-18 18:03:52 +08:00 via iPhone
    k8s 什么版本?用 3.10 内核跑。k8s 怕是老了点
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2914 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 13:58 · PVG 21:58 · LAX 06:58 · JFK 09:58
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.