Merge pull request #37025 from Michelle951/michelle12
[zh] sync service-traffic-policy.mdpull/37152/head
commit
ff2d2b044d
|
|
@ -1,7 +1,11 @@
|
|||
---
|
||||
title: 服务内部流量策略
|
||||
content_type: concept
|
||||
weight: 45
|
||||
weight: 75
|
||||
description: >-
|
||||
如果集群中的两个 Pod 想要通信,并且两个 Pod 实际上都在同一节点运行,
|
||||
**服务内部流量策略** 可以将网络流量限制在该节点内。
|
||||
通过集群网络避免流量往返有助于提高可靠性、增强性能(网络延迟和吞吐量)或降低成本。
|
||||
---
|
||||
<!--
|
||||
---
|
||||
|
|
@ -9,7 +13,12 @@ reviewers:
|
|||
- maplain
|
||||
title: Service Internal Traffic Policy
|
||||
content_type: concept
|
||||
weight: 45
|
||||
weight: 75
|
||||
description: >-
|
||||
If two Pods in your cluster want to communicate, and both Pods are actually running on
|
||||
the same node, _Service Internal Traffic Policy_ to keep network traffic within that node.
|
||||
Avoiding a round trip via the cluster network can help with reliability, performance
|
||||
(network latency and throughput), or cost.
|
||||
---
|
||||
-->
|
||||
|
||||
|
|
@ -23,7 +32,7 @@ internal traffic to endpoints within the node the traffic originated from. The
|
|||
"internal" traffic here refers to traffic originated from Pods in the current
|
||||
cluster. This can help to reduce costs and improve performance.
|
||||
-->
|
||||
_服务内部流量策略_ 开启了内部流量限制,只路由内部流量到和发起方处于相同节点的服务端点。
|
||||
**服务内部流量策略**开启了内部流量限制,将内部流量只路由到发起方所处节点内的服务端点。
|
||||
这里的”内部“流量指当前集群中的 Pod 所发起的流量。
|
||||
这种机制有助于节省开销,提升效率。
|
||||
|
||||
|
|
@ -38,13 +47,13 @@ _服务内部流量策略_ 开启了内部流量限制,只路由内部流量
|
|||
The `ServiceInternalTrafficPolicy` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
|
||||
is a Beta feature and enabled by default.
|
||||
When the feature is enabled, you can enable the internal-only traffic policy for a
|
||||
{{< glossary_tooltip text="Services" term_id="service" >}}, by setting its
|
||||
{{< glossary_tooltip text="Service" term_id="service" >}}, by setting its
|
||||
`.spec.internalTrafficPolicy` to `Local`.
|
||||
This tells kube-proxy to only use node local endpoints for cluster internal traffic.
|
||||
-->
|
||||
`ServiceInternalTrafficPolicy`
|
||||
`ServiceInternalTrafficPolicy`
|
||||
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/) 是 Beta 功能,默认启用。
|
||||
启用该功能后,你就可以通过将 {{< glossary_tooltip text="Services" term_id="service" >}} 的
|
||||
启用该功能后,你就可以通过将 {{< glossary_tooltip text="Service" term_id="service" >}} 的
|
||||
`.spec.internalTrafficPolicy` 项设置为 `Local`,
|
||||
来为它指定一个内部专用的流量策略。
|
||||
此设置就相当于告诉 kube-proxy 对于集群内部流量只能使用本地的服务端口。
|
||||
|
|
@ -113,7 +122,7 @@ kube-proxy 基于 `spec.internalTrafficPolicy` 的设置来过滤路由的目标
|
|||
to `Local` on a Service. It is possible to use both features in the same cluster
|
||||
on different Services, just not on the same Service.
|
||||
-->
|
||||
* 在一个Service上,当 `externalTrafficPolicy` 已设置为 `Local`时,服务内部流量策略无法使用。
|
||||
* 在一个 Service 上,当 `externalTrafficPolicy` 已设置为 `Local`时,服务内部流量策略无法使用。
|
||||
换句话说,在一个集群的不同 Service 上可以同时使用这两个特性,但在一个 Service 上不行。
|
||||
|
||||
## {{% heading "whatsnext" %}}
|
||||
|
|
@ -124,5 +133,5 @@ kube-proxy 基于 `spec.internalTrafficPolicy` 的设置来过滤路由的目标
|
|||
* Read [Connecting Applications with Services](/docs/concepts/services-networking/connect-applications-service/)
|
||||
-->
|
||||
* 请阅读[拓扑感知提示](/zh-cn/docs/concepts/services-networking/topology-aware-hints)
|
||||
* 请阅读[Service 的外部流量策略](/zh-cn/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip)
|
||||
* 请阅读 [Service 的外部流量策略](/zh-cn/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip)
|
||||
* 请阅读[用 Service 连接应用](/zh-cn/docs/concepts/services-networking/connect-applications-service/)
|
||||
|
|
|
|||
Loading…
Reference in New Issue