Comments (6)
@chenk008 macvlan如果不在宿主机上单独做一个虚拟网卡的情况下,本身master网卡和虚拟网卡是无法互通的,可以通过重启网卡达到互通(当然,这不是正常的做法),然后下一次创建新容器,就再次无法互访了。
from hansedong.github.io.
@chenk008 macvlan如果不在宿主机上单独做一个虚拟网卡的情况下,本身master网卡和虚拟网卡是无法互通的,可以通过重启网卡达到互通(当然,这不是正常的做法),然后下一次创建新容器,就再次无法互访了。
我测试了,通过在宿主机上建一个ipvlan的网卡,之后新建的容器还是可以互访的。
在宿主机上保留一个ipvlan网卡,会有什么问题吗?
from hansedong.github.io.
@chenk008
首先,我没有测试过ipvlan在宿主机建立网卡这种方式,我当时只测了macvlan。如果要容器和宿主机互通,还必须得在宿主机保留这样一个网卡(ipvlan可能也是一样的,我只是没测)。单纯就解决容器和宿主机互通的方式来说,在宿主机保留这样这样一个基于macvlan虚拟出来的网卡是完全没有问题的,我们目前线上也是用的这种方式。从我做压测来看,用macvlan(或者ipvlan)跨宿主机容器互通的网络性能损耗为0,也就是几乎就没有性能损耗(相对宿主机直接互通来说)
后来在文章里提,ptp的方式,是因为感觉这种方式更优雅一些。因为不需要额外在宿主机建立网卡,也就不会默认新增路由表,如果服务器有iptables策略,也不会有任何影响。
from hansedong.github.io.
@chenk008
首先,我没有测试过ipvlan在宿主机建立网卡这种方式,我当时只测了macvlan。如果要容器和宿主机互通,还必须得在宿主机保留这样一个网卡(ipvlan可能也是一样的,我只是没测)。单纯就解决容器和宿主机互通的方式来说,在宿主机保留这样这样一个基于macvlan虚拟出来的网卡是完全没有问题的,我们目前线上也是用的这种方式。从我做压测来看,用macvlan(或者ipvlan)跨宿主机容器互通的网络性能损耗为0,也就是几乎就没有性能损耗(相对宿主机直接互通来说)
后来在文章里提,ptp的方式,是因为感觉这种方式更优雅一些。因为不需要额外在宿主机建立网卡,也就不会默认新增路由表,如果服务器有iptables策略,也不会有任何影响。
@hansedong 谢谢您的回复
在您的文章提到:
我们本机利⽤苹果本 虚拟机调试是没有问题的,⽤ KVM 调试,但 Pod 变化触发容器⽹络销毁和新建这种变化时,宿主机就⽆法访问容 器⽹络了,⽽且,在同⼀个宿主机上,宿主机对其内的有些容器可以访问,有些容器不能访问,⾮常奇怪,这个问 题,可能在物理机上不⼀定存在,但是在调研阶段,我们必须要考虑其在线上物理机环境也⽆法实施或者后续遇到 类似问题的情况。所以,我们尝试更换了多个操作系统的Linux内核版本,问题依然,只能另寻他法。
这个问题还存在吗?我这边用ipvlan测试都正常的
from hansedong.github.io.
@chenk008 KVM上是有这个问题的。目前还没有彻底搞清楚。在物理机和虚拟机没有这个问题。
可能是我们当时测试时,KVM哪些环节有问题。
from hansedong.github.io.
@chenk008 KVM上是有这个问题的。目前还没有彻底搞清楚。在物理机和虚拟机没有这个问题。
可能是我们当时测试时,KVM哪些环节有问题。
好的,谢谢您的回复
from hansedong.github.io.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hansedong.github.io.