@@ -52,14 +52,12 @@ to endpoints within the same zone.
52
52
By setting `topologyKeys` on a Service, you're able to define a policy for routing
53
53
traffic based upon the Node labels for the originating and destination Nodes.
54
54
-->
55
- ## 拓扑感知的流量路由
55
+ ## 拓扑感知的流量路由 {#topology-aware-traffic-routing}
56
56
57
- 默认情况下,发往 ` ClusterIP ` 或者 ` NodePort ` 服务的流量可能会被路由到
58
- 服务的任一后端的地址。Kubernetes 1.7 允许将“外部”流量路由到接收到流量的
59
- 节点上的 Pod。对于 ` ClusterIP ` 服务,无法完成同节点优先的路由,你也无法
60
- 配置集群优选路由到同一可用区中的端点。
61
- 通过在 Service 上配置 ` topologyKeys ` ,你可以基于来源节点和目标节点的
62
- 标签来定义流量路由策略。
57
+ 默认情况下,发往 ` ClusterIP ` 或者 ` NodePort ` 服务的流量可能会被路由到服务的任一后端的地址。
58
+ Kubernetes 1.7 允许将“外部”流量路由到接收到流量的节点上的 Pod。对于 ` ClusterIP `
59
+ 服务,无法完成同节点优先的路由,你也无法配置集群优选路由到同一可用区中的端点。
60
+ 通过在 Service 上配置 ` topologyKeys ` ,你可以基于来源节点和目标节点的标签来定义流量路由策略。
63
61
64
62
<!--
65
63
The label matching between the source and destination lets you, as a cluster
@@ -76,8 +74,8 @@ same top-of-rack switch for the lowest latency.
76
74
来定义节点集合。你可以基于符合自身需求的任何度量值来定义标签。
77
75
例如,在公有云上,你可能更偏向于把流量控制在同一区内,因为区间流量是有费用成本的,
78
76
而区内流量则没有。
79
- 其它常见需求还包括把流量路由到由 ` DaemonSet ` 管理的本地 Pod 上,或者
80
- 把将流量转发到连接在同一机架交换机的节点上 ,以获得低延时。
77
+ 其它常见需求还包括把流量路由到由 ` DaemonSet ` 管理的本地 Pod
78
+ 上,或者把将流量转发到连接在同一机架交换机的节点上 ,以获得低延时。
81
79
82
80
<!--
83
81
## Using Service Topology
@@ -183,7 +181,7 @@ traffic as follows.
183
181
184
182
The following are common examples of using the Service Topology feature.
185
183
-->
186
- ## 示例
184
+ ## 示例 {#examples}
187
185
188
186
以下是使用服务拓扑功能的常见示例。
189
187
@@ -192,7 +190,7 @@ The following are common examples of using the Service Topology feature.
192
190
193
191
A Service that only routes to node local endpoints. If no endpoints exist on the node, traffic is dropped:
194
192
-->
195
- ### 仅节点本地端点
193
+ ### 仅节点本地端点 {#only-node-local-endpoints}
196
194
197
195
仅路由到节点本地端点的一种服务。如果节点上不存在端点,流量则被丢弃:
198
196
@@ -217,7 +215,7 @@ spec:
217
215
218
216
A Service that prefers node local Endpoints but falls back to cluster wide endpoints if node local endpoints do not exist:
219
217
-->
220
- ### 首选节点本地端点
218
+ ### 首选节点本地端点 {#prefer-node-local-endpoints}
221
219
222
220
首选节点本地端点,如果节点本地端点不存在,则回退到集群范围端点的一种服务:
223
221
@@ -243,7 +241,7 @@ spec:
243
241
244
242
A Service that prefers zonal then regional endpoints. If no endpoints exist in either, traffic is dropped.
245
243
-->
246
- ### 仅地域或区域端点
244
+ ### 仅地域或区域端点 {#only-zonal-or-regional-endpoints}
247
245
248
246
首选地域端点而不是区域端点的一种服务。 如果以上两种范围内均不存在端点,
249
247
流量则被丢弃。
@@ -270,10 +268,9 @@ spec:
270
268
271
269
A Service that prefers node local, zonal, then regional endpoints but falls back to cluster wide endpoints.
272
270
-->
273
- ### 优先选择节点本地端点、地域端点,然后是区域端点
271
+ ### 优先选择节点本地端点、地域端点,然后是区域端点 {#prefer-node-local-zonal-then-regional-endpoints}
274
272
275
- 优先选择节点本地端点,地域端点,然后是区域端点,最后才是集群范围端点的
276
- 一种服务。
273
+ 优先选择节点本地端点,地域端点,然后是区域端点,最后才是集群范围端点的一种服务。
277
274
278
275
` ` ` yaml
279
276
apiVersion : v1
0 commit comments