在 Kubernetes 的网络规范中,要求 Node 可以和所有的 Pod 直接通信。为了达到这个目的 Kube-OVN 创建了一个 join 子网,并在每个 Node 节点创建了一块虚拟网卡 ovn0 接入 join 子网,通过该网络完成主机和 Pod 之间的网络互通。
查看 Node 子网
- [root@node2 yamls]# kubectl get subnet join -o yaml
- apiVersion: kubeovn.io/v1
- kind: Subnet
- metadata:
- creationTimestamp: "2019-08-06T09:33:43Z"
- generation: 1
- name: join
- resourceVersion: "1571333"
- selfLink: /apis/kubeovn.io/v1/subnets/join
- uid: 9c744810-c678-4d50-8a7d-b8ec12ef91b8
- spec:
- cidrBlock: 100.64.0.0/16
- default: false
- excludeIps:
- - 100.64.0.1
- gateway: 100.64.0.1
- gatewayNode: ""
- gatewayType: ""
- natOutgoing: false
- private: false
- protocol: IPv4
在 node 节点查看 ovn0 网卡
- [root@node2 yamls]# ifconfig ovn0
- ovn0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1420
- inet 100.64.0.4 netmask 255.255.0.0 broadcast 100.64.255.255
- inet6 fe80::800:ff:fe40:5 prefixlen 64 scopeid 0x20<link>
- ether 0a:00:00:40:00:05 txqueuelen 1000 (Ethernet)
- RX packets 18 bytes 1428 (1.3 KiB)
- RX errors 0 dropped 0 overruns 0 frame 0
- TX packets 19 bytes 1810 (1.7 KiB)
- TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
配置 Node 子网
Node 子网为安装时指定,创建后无法修改。如需安装时自定义 node 子网的 CIDR 等信息请参考配置内置网络