当前位置:网站首页>Flannel 工作原理
Flannel 工作原理
2022-06-23 06:23:00 【summer_west_fish】
Flannel是CoreOS团队针对Kubernetes设计的一个网络规划服务,简单来说,它的功能是让集群中的不同节点主机创建的Docker容器都具有全集群唯一的虚拟IP地址(让每个docker0分配的网段不一样,container的IP自然不一样)。而且它还能在这些IP地址之间建立一个覆盖网络(Overlay Network:也就是将TCP数据包装在另一种网络包里面进行路由转发和通信),通过这个覆盖网络,将数据包原封不动地传递到目标容器内。
Flannel的支持多种网络模式,常用用都是vxlan、UDP、hostgw、ipip以及gce和阿里云等。vxlan和UDP的区别是vxlan是内核封包,而UDP是flanneld用户态程序封包,所以UDP的方式性能会稍差;

ETCD 之Flannel提供说明
- 存储管理Flannel可分配的IP地址段资源;
- 监控ETCD中每个Pod的实际地址,并在内存中建立维护Pod节点路由表。
不同情况下网络通信方法
同一个pod内部通讯: 同一个pod共享同一个网络命名空间,共享一个Linux协议栈
pod1 至 pod2
1、pod1与pod2不在同一台主机,pod的地址是与docker0在同一个网段的,但docker0网段与宿主机网卡是两个完全不同的IP段,并且不同Node之间的通信只能通过宿主机的物理网卡进行。将Pod的IP和所在Node的IP关联起来,通过这个关联让Pod可以互相访问。
2、pod1 与 pod2在同一台机器,由docker0网桥直接转发请求至pod2,不需要经过Flannel。
Pod至Service的网络:目前基于性能考虑,全部为iptables维护和转发
Pod到外网:Pod向外网发送请求,查找路由表,转发数据包到宿主机的网卡,宿主网卡完成路由选择后,iptables执行Masquerade,把源IP更改为宿主网卡的IP,然后向外网服务器发送请求。
边栏推荐
- 312. poke the balloon
- [bull Chinese document] queue package used to process distributed jobs and messages in nodejs
- Advanced drawing skills of Excel lecture 100 (VIII) -excel drawing WiFi diagram
- 898. 子数组按位或操作
- [system] right click the desktop icon. After turning around, the Explorer will crash and the desktop will be refreshed
- 900. RLE 迭代器
- 318. 最大单词长度乘积
- 295. 数据流的中位数
- C DPI adaptation problem
- A small method of debugging equipment serial port information with ADB
猜你喜欢

100 GIS practical application cases (79) - key points of making multi plan integrated base map

深度学习系列47:styleGAN总结

TensorFlow中的数据类型
![[STL] unordered of associated container_ Map Usage Summary](/img/6a/d614f2f363fa5181c25e79ff8b0dab.png)
[STL] unordered of associated container_ Map Usage Summary

启发式的搜索策略
![[project training] multi segment line expanded to parallel line](/img/f2/ee4985fd2454bf00d600e34a818f2d.png)
[project training] multi segment line expanded to parallel line

MySQL mvcc multi version concurrency control

WPF command directive and inotifypropertychanged
![[STL] summary of map usage of associated containers](/img/1d/1b6488ea47face0548500b1e1ec60d.png)
[STL] summary of map usage of associated containers

【***数组***】
随机推荐
898. subarray bitwise OR operation
U-Net: Convolutional Networks for Biomedical Image Segmentation
别找了诸位 【十二款超级好用的谷歌插件都在这】(确定不来看看?)
Xshell7 Download
How to verify date format in PHP (regular)
406 double pointer (27. remove elements, 977. square of ordered array, 15. sum of three numbers, 18. sum of four numbers)
407-栈与队列(232.用栈实现队列、225. 用队列实现栈)
.h5文件忘记数据库名字,使用h5py打印
Pspnet complete code implementation
The illustration shows three handshakes and four waves. Xiaobai can understand them
20220621 Three Conjugates of Dual Quaternions
TP6 安装拓展
WPF command directive and inotifypropertychanged
[STL] summary of stack and queue usage of container adapter
Eureka
How to achieve efficient network information dissemination
Paddle version problem
[project training 10] drawing of arrows
Side effects of threads in embedded real-time systems
Add IPAD control function into shairplay