You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[节点](/zh/docs/concepts/architecture/nodes/)上的 Pod 可以不通过 NAT 和其他任何节点上的 Pod 通信
42
+
* 节点上的代理(比如:系统守护进程、kubelet)可以和节点上的所有 Pod 通信
43
+
44
+
备注:对于支持在主机网络中运行 `Pod` 的平台(比如:Linux):
45
+
46
+
* 运行在节点主机网络里的 Pod 可以不通过 NAT 和所有节点上的 Pod 通信
47
+
48
+
<!--
49
+
This model is not only less complex overall, but it is principally compatible
50
+
with the desire for Kubernetes to enable low-friction porting of apps from VMs
51
+
to containers. If your job previously ran in a VM, your VM had an IP and could
52
+
talk to other VMs in your project. This is the same basic model.
53
+
54
+
Kubernetes IP addresses exist at the `Pod` scope - containers within a `Pod`
55
+
share their network namespaces - including their IP address and MAC address.
56
+
This means that containers within a `Pod` can all reach each other's ports on
57
+
`localhost`. This also means that containers within a `Pod` must coordinate port
58
+
usage, but this is no different from processes in a VM. This is called the
59
+
"IP-per-pod" model.
60
+
-->
61
+
这个模型不仅不复杂,而且还和 Kubernetes 的实现从虚拟机向容器平滑迁移的初衷相符,
62
+
如果你的任务开始是在虚拟机中运行的,你的虚拟机有一个 IP,
63
+
可以和项目中其他虚拟机通信。这里的模型是基本相同的。
64
+
65
+
Kubernetes 的 IP 地址存在于 `Pod` 范围内 - 容器共享它们的网络命名空间 - 包括它们的 IP 地址和 MAC 地址。
66
+
这就意味着 `Pod` 内的容器都可以通过 `localhost` 到达对方端口。
67
+
这也意味着 `Pod` 内的容器需要相互协调端口的使用,但是这和虚拟机中的进程似乎没有什么不同,
68
+
这也被称为“一个 Pod 一个 IP”模型。
69
+
70
+
<!--
71
+
How this is implemented is a detail of the particular container runtime in use.
72
+
73
+
It is possible to request ports on the `Node` itself which forward to your `Pod`
74
+
(called host ports), but this is a very niche operation. How that forwarding is
75
+
implemented is also a detail of the container runtime. The `Pod` itself is
76
+
blind to the existence or non-existence of host ports.
77
+
-->
78
+
如何实现以上需求是所使用的特定容器运行时的细节。
79
+
80
+
也可以在 `Node` 本身请求端口,并用这类端口转发到你的 `Pod`(称之为主机端口),
81
+
但这是一个很特殊的操作。转发方式如何实现也是容器运行时的细节。
82
+
`Pod` 自己并不知道这些主机端口的存在。
83
+
7
84
<!--
8
85
Kubernetes networking addresses four concerns:
9
-
- Containers within a Pod use networking to communicate via loopback.
86
+
- Containers within a Pod [use networking to communicate](/docs/concepts/services-networking/dns-pod-service/) via loopback.
10
87
- Cluster networking provides communication between different Pods.
11
-
- The Service resource lets you expose an application running in Pods to be reachable from outside your cluster.
12
-
- You can also use Services to publish services only for consumption inside your cluster.
88
+
- The [Service resource](/docs/concepts/services-networking/service/) lets you [expose an application running in Pods](/docs/concepts/services-networking/connect-applications-service/) to be reachable from outside your cluster.
89
+
- You can also use Services to [publish services only for consumption inside your cluster](/docs/concepts/services-networking/service-traffic-policy/).
13
90
-->
14
91
15
92
Kubernetes 网络解决四方面的问题:
16
-
- 一个 Pod 中的容器之间通过本地回路(loopback)通信。
93
+
- 一个 Pod 中的容器之间[通过本地回路(loopback)通信](/zh/docs/concepts/services-networking/dns-pod-service/)。
0 commit comments