当前位置:网站首页>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,然后向外网服务器发送请求。
边栏推荐
- deeplab v3 代码结构图
- [STL] unordered of associated container_ Map Usage Summary
- Database principle experiment test questions, about book classification table
- Intentional shared lock, intentional exclusive lock and deadlock of MySQL
- 309. the best time to buy and sell stocks includes the freezing period
- 318. 最大单词长度乘积
- Too much if logic in JS, common optimization
- paddle版本问题
- Quartz调度框架的学习使用
- Unet代码实现
猜你喜欢

TensorFlow中的数据类型

别找了诸位 【十二款超级好用的谷歌插件都在这】(确定不来看看?)

20220621 Three Conjugates of Dual Quaternions

云原生落地进入深水区,博云容器云产品族释放四大价值

Chrome remove duplicate bookmarks
![Don't look for [12 super easy-to-use Google plug-ins are here] (are you sure you want to take a look?)](/img/45/3e43faf7aba6741825ccb9719b8445.png)
Don't look for [12 super easy-to-use Google plug-ins are here] (are you sure you want to take a look?)

Run typescript code directly using TS node

GINet
![[bull Chinese document] queue package used to process distributed jobs and messages in nodejs](/img/f9/1bd79d3754c1b4d1b114d02283f95e.png)
[bull Chinese document] queue package used to process distributed jobs and messages in nodejs

Learning and using quartz scheduling framework
随机推荐
System permission program cannot access SD card
【项目实训】线形组件的细节
About Supervision
云原生落地进入深水区,博云容器云产品族释放四大价值
20220621 Three Conjugates of Dual Quaternions
MySQL redo log redo log
901. stock price span
junit单元测试报错org.junit.runners.model.InvalidTestClassError: Invalid test class ‘xxx‘ .No runnable meth
【项目实训10】箭头的绘制
Database principle experiment test questions, about book classification table
How to migrate virtual machines from VirtualBox to hype-v
JS dynamically creates a href circular download file. Only 10 or a fixed number of files can be downloaded
Side effects of threads in embedded real-time systems
The List
306. 累加数
Unet代码实现
直播回顾 | 传统应用进行容器化改造,如何既快又稳?
Project_ Filter to solve Chinese garbled code
[STL] summary of map usage of associated containers
paddle版本问题