flannel 配置使用超过 255 个节点

flannel config use more than 255 nodes

我需要在 kubernetes 上安装 flannel。我的净范围是 10.101.0.0/16。我需要管理大约 1500 个节点(裸机)。 我的法兰绒配置是

"Network": "10.101.0.0/16"

Flannel 将为每个节点设置 10.101.x.0/32,因此最大 noes 数量为 255。我应该如何更改配置以使其适用于 1500 个节点??

Flannel 为每个主机提供一个 IP 子网(默认为 /24),Docker 守护程序可以从中为各个容器分配 IP。

您可以将默认 IP 子网掩码更改为任何您想要的。这允许您拥有更多节点,但另一方面它减少了节点中 pods 的数量。

因此,如果您不想更改网络范围(“10.101.0.0/16”)并仍然使用 flannel,您可以设置:

/25 as default IP subnet netmask and be able to have 512 nodes with 125 pods each;

/26 as default IP subnet netmask and be able to have 1024 nodes with 61 pods each;

/27 as default IP subnet netmask and be able to have 2048 nodes with 29 pods each.

为了从上面设置任何范围,只需在 etcd 站点上创建它。例如:

etcdctl --peers="{{ etcd_servers }}" set /coreos.com/network/config '{"Network":"10.101.0.0/16","SubnetLen": 25}'
/25 as default IP subnet netmask and be able to have 512 nodes with 125 pods each;

/26 as default IP subnet netmask and be able to have 1024 nodes with 61 pods each;

/27 as default IP subnet netmask and be able to have 2048 nodes with 29 pods each.

我可以再解释一下吗?当前缀为 25 时,提供了 128 - 2 个 IP,但节点将使用 ...1 或 **...129,所以有 128 - 2 - 1 提供给 Pods。 当前缀为 26 时,Node 将使用 **...1 或 **...65 或 **...129 or **..**.193,所以一个节点上Pods只有61个IP.