当前位置:网站首页>Understand network namespaces
Understand network namespaces
2022-07-19 02:50:00 【Lao Duan studio】
We eat out , There are many tables in the hall , So these people share one " Dining space ".
If we go to the private room for dinner , Every private room is a " Dining space ", Private rooms and private rooms , Private rooms and halls are independent , non-interfering .
For a system , All applications in this system, whether wechat or QQ, they “ All eat in the hall ”, They share a “ Dining space ”, What we want to say about cyberspace is similar to that here “ Dining space ”.
If you run two here web Applications , For example, first run nginx, Run again apache, Because they are in the same cyberspace , therefore apache It doesn't work , Because it will cause port conflict , One mountain can't hold two tigers .
If we run three virtual machines in the host , The network space of the host computer is “ hall ”, Every virtual machine is “ Private Room ”, They have their own independent cyberspace , So we ran on the host nginx, Run on three virtual machines respectively nginx perhaps apache There will be no conflict , Because they are in their own cyberspace .
The same is true for the corresponding container .
If we run three containers in the host , The network space of the host computer is “ hall ”, Every container is “ Private Room ”, They have their own independent cyberspace , So we ran on the host nginx, Run on three virtual machines respectively nginx perhaps apache There will be no conflict , Because they are in their own cyberspace .
If we put the container C1 and C2 Give it your head “ cut off ”, It's like tearing down the doors of two private rooms , Then these containers share the network space of the host . Suppose that c1 It's running nginx Words , What he occupies is the port of the host 80, that C2 Or the host cannot run nginx perhaps apache 了 , Because they share a cyberspace , port 80 It's already occupied , But it doesn't affect C3 Up operation apache perhaps nginx.
For some C/S For the application of architecture , We install the client on k8s In the cluster pod Way to run , The server may be running on a host or virtual machine outside the cluster , Here's the picture .
Then someone will say , These agents can connect to the server , But the server can't contact these agents, so what should I do ? In fact, we are creating these agents pod when , Just set these pod Just use the network space of the host , That is to say pod Of .spec. Add below hostNetwork: true, Access the server in this way IP You can access these pod 了 .
边栏推荐
- 安装软件提示无法定位程序输入点AddDllDirectory于动态链接库Kernel32.dll上(文末有下载地址)
- RHCE8学习指南第2章 基本命令的使用
- Net-Snmp 相关命令
- 10.系统安全及应用
- Dynamic programming problem - Small Soldiers rush forward
- Oracle中字符串截取最全方法总结
- Convert string to integer
- Regular and extended expressions, sed text processor and awk tool, changing IP address with script
- win10网络连接显示无网络但可以上网
- Sword finger offer 48 The longest substring without repeated characters
猜你喜欢
随机推荐
Leetcode --- one question per day
Dynamic programming problem - Small Soldiers rush forward
FTP服务
Chapter 1 - multi agent system
DHCP服务
数组、冒泡的认识
SSH远程控制与访问
HCIA静态综合实验
Net-Snmp 相关命令
expect免交互
Arm cross compiler naming rules
module_init函数底层原理
使用gatekeeper限制kubernetes创建特定类型的资源
Metersphere is based on JMeter distributed performance pressure testing platform
Oracle中字符串截取最全方法总结
PXE自动化安装
Flyway的SaaS多租户实现方案
HCIA_OSPF实验
Bladex - a well-designed microservice architecture
Gzip的动态压缩和静态压缩详解









