在 k8s1.16 中使用 kubenet 和双栈时,如何配置以在另一个节点上 ping cbr0 gw?

In k8s1.16 when using kubenet and dual-stack, How to config to ping cbr0 gw on another node?

我安装了一个有两个节点的 kubernetes v1.16 集群,并在 this guide 之后启用了 "IPv4/IPv6 dual-stack"。对于 "dual-stack",我将 --network-plugin=kubenet 设置为 kubelet。

现在,pods 有 ipv4 和 ipv6 地址,每个节点都有一个同时有 ipv4 和 ipv6 地址的 cbr0 gw。 但是当我从一个节点ping到另一个节点的cbr0 gw时,它失败了。

我尝试手动添加如下路线: "ip route add [podCIDR of other node] via [ipaddress of other node]"

我在两个节点上添加路由后,我可以用ipv4 ping cbr0 gw 成功。 但是"adding route manually"好像不是一个正确的方法。

当我使用kubenet时,我应该如何配置从一个节点ping到另一个节点的cbr0 gw?

Kubenet是一个requirement for enabling IPv6 and as you stated, kubenet have some limitations and here我们可以阅读:

Kubenet is a very basic, simple network plugin, on Linux only. It does not, of itself, implement more advanced features like cross-node networking or network policy. It is typically used together with a cloud provider that sets up routing rules for communication between nodes, or in single-node environments.

我想强调一下,kubenet 不会自动为您创建路由。

根据这些信息,我们可以理解在您的场景中这是预期的行为,不会发生任何问题。 如果您想继续朝这个方向前进,您需要手动创建路线。

请务必记住这是一个 alpha 功能 (WIP)。

还有一些工作正在做,以便 bootstrap 成为 Kubernetes cluster with Dual Stack using Kubeadm,但它还不能用,也没有预计到达时间。

this repository 中有一些使用其他网络插件进行 IPv6 和双栈设置的示例,但它仍然需要手动添加路由。

This project serves two primary purposes: (i) study and validate ipv6 support in kubernetes and associated plugins (ii) provide a dev environment for implementing and testing additional functionality (e.g.dual-stack)