|
| 1 | +--- |
| 2 | +title: 开启服务拓扑 |
| 3 | +content_type: task |
| 4 | +--- |
| 5 | + |
| 6 | +<!-- overview --> |
| 7 | +<!-- |
| 8 | +This page provides an overview of enabling Service Topology in Kubernetes. |
| 9 | +--> |
| 10 | +本页面提供了在 Kubernetes 中启用服务拓扑的概述。 |
| 11 | + |
| 12 | +## {{% heading "prerequisites" %}} |
| 13 | + |
| 14 | + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} |
| 15 | + |
| 16 | + |
| 17 | +<!-- steps --> |
| 18 | +<!-- |
| 19 | +## Introduction |
| 20 | +
|
| 21 | +_Service Topology_ enables a service to route traffic based upon the Node |
| 22 | +topology of the cluster. For example, a service can specify that traffic be |
| 23 | +preferentially routed to endpoints that are on the same Node as the client, or |
| 24 | +in the same availability zone. |
| 25 | +--> |
| 26 | +## 介绍 |
| 27 | + |
| 28 | +_服务拓扑(Service Topology)_ 使服务能够根据集群中的 Node 拓扑来路由流量。 |
| 29 | +比如,服务可以指定将流量优先路由到与客户端位于同一节点或者同一可用区域的端点上。 |
| 30 | + |
| 31 | +<!-- |
| 32 | +## Prerequisites |
| 33 | +
|
| 34 | +The following prerequisites are needed in order to enable topology aware service |
| 35 | +routing: |
| 36 | +
|
| 37 | + * Kubernetes 1.17 or later |
| 38 | + * {{< glossary_tooltip text="Kube-proxy" term_id="kube-proxy" >}} running in iptables mode or IPVS mode |
| 39 | + * Enable [Endpoint Slices](/docs/concepts/services-networking/endpoint-slices/) |
| 40 | +--> |
| 41 | +## 先决条件 |
| 42 | + |
| 43 | +需要下面列的先决条件,才能启用拓扑感知的服务路由: |
| 44 | + |
| 45 | + * Kubernetes 1.17 或更新版本 |
| 46 | + * {{< glossary_tooltip text="Kube-proxy" term_id="kube-proxy" >}} 以 iptables 或者 IPVS 模式运行 |
| 47 | + * 启用[端点切片](/zh/docs/concepts/services-networking/endpoint-slices/) |
| 48 | + |
| 49 | +<!-- |
| 50 | +## Enable Service Topology |
| 51 | +
|
| 52 | +{{< feature-state for_k8s_version="v1.17" state="alpha" >}} |
| 53 | +
|
| 54 | +To enable service topology, enable the `ServiceTopology` and `EndpointSlice` feature gate for all Kubernetes components: |
| 55 | +--> |
| 56 | +## 启用服务拓扑 |
| 57 | + |
| 58 | +{{< feature-state for_k8s_version="v1.17" state="alpha" >}} |
| 59 | + |
| 60 | +要启用服务拓扑功能,需要为所有 Kubernetes 组件启用 `ServiceTopology` 和 `EndpointSlice` 特性门控: |
| 61 | + |
| 62 | +``` |
| 63 | +--feature-gates="ServiceTopology=true,EndpointSlice=true" |
| 64 | +``` |
| 65 | + |
| 66 | + |
| 67 | +## {{% heading "whatsnext" %}} |
| 68 | + |
| 69 | +<!-- |
| 70 | +* Read about the [Service Topology](/docs/concepts/services-networking/service-topology) concept |
| 71 | +* Read about [Endpoint Slices](/docs/concepts/services-networking/endpoint-slices) |
| 72 | +* Read [Connecting Applications with Services](/docs/concepts/services-networking/connect-applications-service/) |
| 73 | +--> |
| 74 | +* 阅读[服务拓扑](/zh/docs/concepts/services-networking/service-topology)概念 |
| 75 | +* 阅读[端点切片](/zh/docs/concepts/services-networking/endpoint-slices) |
| 76 | +* 阅读[通过服务来连接应用](/zh/docs/concepts/services-networking/connect-applications-service/) |
0 commit comments