weixin_39550937
weixin_39550937
2020-12-05 05:48

ipvlan support default route

When I use flannel with ipVlan, I need the default route in container. Add "isDefaultGateway" in ipVlan, ipVlan can work in Kubernetes with 'l3s' mode.

该提问来源于开源项目:containernetworking/plugins

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

4条回答

  • weixin_39719585 weixin_39719585 5月前

    Typically this would be solved by adding the default route to the 'routes' section of the CNI configuration. Does that work for you?

    
    {
        "cniVersion": "0.3.1",
        "name": "example",
        "type": "ipvlan",
        "ipam": {
            "type": "host-local",
            "subnet": "10.88.0.0/16",
            "routes": [
                { "dst": "0.0.0.0/0" }
            ]
        }
    }
    
    点赞 评论 复制链接分享
  • weixin_39550937 weixin_39550937 5月前

    Typically this would be solved by adding the default route to the 'routes' section of the CNI configuration. Does that work for you?

    
    {
        "cniVersion": "0.3.1",
        "name": "example",
        "type": "ipvlan",
        "ipam": {
            "type": "host-local",
            "subnet": "10.88.0.0/16",
            "routes": [
                { "dst": "0.0.0.0/0" }
            ]
        }
    }
    

    Thank you for reviewing. I use ipvlan with flannel in kubernetes.The ipam config is generated by flannel,and flannel do not has a config for route.So i think default route is need.

    点赞 评论 复制链接分享
  • weixin_39719585 weixin_39719585 5月前

    Aha. So what we should do here is to modify the flannel plugin to accept an IPAM block like other plugins, and allow the 'routes' option in that block (but not the IP addressing stuff which flannel handles independently).

    点赞 评论 复制链接分享
  • weixin_39550937 weixin_39550937 5月前

    I use "isDefaultGateway" inspired by this bridge plugin.When i use flannel with bridge , i have to set isDefaultGateway=true. Maybe flannel also need support ipam config , but now flannel is not support.The flannel will fail for "'delegate' dictionary must not have 'ipam' field, it'll be set by flannel"

    点赞 评论 复制链接分享

相关推荐