Skip to content

Commit 52f0a16

Browse files
authored
Merge pull request #29797 from steven-my/29329-translation-for-admin-1
[zh] translation for admin1
2 parents e3544b2 + ea36ff4 commit 52f0a16

File tree

4 files changed

+104
-70
lines changed

4 files changed

+104
-70
lines changed
Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,83 @@
11
---
22
title: 开启服务拓扑
33
content_type: task
4+
min-kubernetes-server-version: 1.17
45
---
56

67
<!-- overview -->
8+
{{< feature-state for_k8s_version="v1.21" state="deprecated" >}}
79
<!--
8-
This page provides an overview of enabling Service Topology in Kubernetes.
10+
This feature, specifically the alpha `topologyKeys` field, is deprecated since
11+
Kubernetes v1.21.
12+
[Topology Aware Hints](/docs/concepts/services-networking/topology-aware-hints/),
13+
introduced in Kubernetes v1.21, provide similar functionality.
914
-->
10-
本页面提供了在 Kubernetes 中启用服务拓扑的概述。
15+
这项功能,特别是 Alpha 状态的 `topologyKeys` 字段,在 kubernetes v1.21 中已经弃用。
16+
在 kubernetes v1.21 加入的[拓扑感知提示](/zh/docs/concepts/services-networking/topology-aware-hints/)
17+
提供了类似的功能。
1118

1219
## {{% heading "prerequisites" %}}
1320

1421
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
1522

16-
17-
<!-- steps -->
1823
<!--
19-
## Introduction
20-
21-
_Service Topology_ enables a service to route traffic based upon the Node
24+
_Service Topology_ enables a {{< glossary_tooltip term_id="service">}} to route traffic based upon the Node
2225
topology of the cluster. For example, a service can specify that traffic be
2326
preferentially routed to endpoints that are on the same Node as the client, or
2427
in the same availability zone.
2528
-->
26-
## 介绍
2729

28-
_服务拓扑(Service Topology)_ 使服务能够根据集群中的 Node 拓扑来路由流量。
30+
_服务拓扑(Service Topology)_ 使 {{< glossary_tooltip term_id="service" text="服务">}}
31+
能够根据集群中的 Node 拓扑来路由流量。
2932
比如,服务可以指定将流量优先路由到与客户端位于同一节点或者同一可用区域的端点上。
3033

31-
<!--
32-
## Prerequisites
34+
## {{% heading "prerequisites" %}}
35+
36+
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
3337

38+
<!--
3439
The following prerequisites are needed in order to enable topology aware service
3540
routing:
3641
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/)
42+
* Kubernetes v1.17 or later
43+
* Configure {{< glossary_tooltip text="kube-proxy" term_id="kube-proxy" >}} to run in iptables mode or IPVS mode
4044
-->
41-
## 先决条件
42-
4345
需要下面列的先决条件,才能启用拓扑感知的服务路由:
4446

4547
* Kubernetes 1.17 或更新版本
46-
* {{< glossary_tooltip text="Kube-proxy" term_id="kube-proxy" >}} 以 iptables 或者 IPVS 模式运行
47-
* 启用[端点切片](/zh/docs/concepts/services-networking/endpoint-slices/)
48+
* 配置 {{< glossary_tooltip text="kube-proxy" term_id="kube-proxy" >}} 以 iptables 或者 IPVS 模式运行
49+
<!-- steps -->
4850

4951
<!--
5052
## Enable Service Topology
5153
52-
{{< feature-state for_k8s_version="v1.17" state="alpha" >}}
54+
{{< feature-state for_k8s_version="v1.21" state="deprecated" >}}
5355
54-
To enable service topology, enable the `ServiceTopology` and `EndpointSlice` feature gate for all Kubernetes components:
56+
To enable service topology, enable the `ServiceTopology`
57+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) for all Kubernetes components:
5558
-->
5659
## 启用服务拓扑
5760

58-
{{< feature-state for_k8s_version="v1.17" state="alpha" >}}
61+
{{< feature-state for_k8s_version="v1.21" state="deprecated" >}}
5962

60-
要启用服务拓扑功能,需要为所有 Kubernetes 组件启用 `ServiceTopology``EndpointSlice` 特性门控:
63+
要启用服务拓扑功能,需要为所有 Kubernetes 组件启用 `ServiceTopology`
64+
[特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)
6165

6266
```
63-
--feature-gates="ServiceTopology=true,EndpointSlice=true"
67+
--feature-gates="ServiceTopology=true`
6468
```
6569

6670

6771
## {{% heading "whatsnext" %}}
6872

6973
<!--
70-
* Read about the [Service Topology](/docs/concepts/services-networking/service-topology) concept
71-
* Read about [Endpoint Slices](/docs/concepts/services-networking/endpoint-slices)
74+
* Read about [Topology Aware Hints](/docs/concepts/services-networking/topology-aware-hints/), the replacement for the `topologyKeys` field.
75+
* Read about [EndpointSlices](/docs/concepts/services-networking/endpoint-slices/)
76+
* Read about the [Service Topology](/docs/concepts/services-networking/service-topology/) concept
7277
* Read [Connecting Applications with Services](/docs/concepts/services-networking/connect-applications-service/)
7378
-->
74-
* 阅读[服务拓扑](/zh/docs/concepts/services-networking/service-topology)概念
79+
80+
* 阅读[拓扑感知提示](/zh/docs/concepts/services-networking/topology-aware-hints/),该技术是用来替换 `topologyKeys` 字段的。
7581
* 阅读[端点切片](/zh/docs/concepts/services-networking/endpoint-slices)
82+
* 阅读[服务拓扑](/zh/docs/concepts/services-networking/service-topology)概念
7683
* 阅读[通过服务来连接应用](/zh/docs/concepts/services-networking/connect-applications-service/)

content/zh/docs/tasks/administer-cluster/kubelet-config-file.md

Lines changed: 31 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -12,43 +12,31 @@ content_type: task
1212

1313
<!-- overview -->
1414

15-
{{< feature-state for_k8s_version="v1.10" state="beta" >}}
16-
1715
<!--
1816
A subset of the Kubelet's configuration parameters may be
1917
set via an on-disk config file, as a substitute for command-line flags.
20-
This functionality is considered beta in v1.10.
2118
--->
2219
通过保存在硬盘的配置文件设置 kubelet 的部分配置参数,这可以作为命令行参数的替代。
23-
此功能在 v1.10 中为 beta 版。
2420

2521
<!--
2622
Providing parameters via a config file is the recommended approach because
2723
it simplifies node deployment and configuration management.
2824
--->
2925
建议通过配置文件的方式提供参数,因为这样可以简化节点部署和配置管理。
3026

31-
## {{% heading "prerequisites" %}}
32-
33-
<!--
34-
- A v1.10 or higher Kubelet binary must be installed for beta functionality.
35-
-->
36-
- 需要安装 1.10 或更高版本的 kubelet 可执行文件,才能使用此 beta 功能。
37-
3827
<!-- steps -->
3928

4029
<!--
4130
## Create the config file
4231
4332
The subset of the Kubelet's configuration that can be configured via a file
44-
is defined by the `KubeletConfiguration` struct
45-
[here (v1beta1)](https://github.com/kubernetes/kubernetes/blob/{{< param "docsbranch" >}}/staging/src/k8s.io/kubelet/config/v1beta1/types.go).
33+
is defined by the
34+
[`KubeletConfiguration`](/docs/reference/config-api/kubelet-config.v1beta1/)
35+
struct.
4636
-->
4737
## 创建配置文件
4838

49-
`KubeletConfiguration` 结构体定义了可以通过文件配置的 Kubelet 配置子集,
50-
该结构体在 [这里(v1beta1)](https://github.com/kubernetes/kubernetes/blob/{{< param "docsbranch" >}}/staging/src/k8s.io/kubelet/config/v1beta1/types.go)
51-
可以找到。
39+
[`KubeletConfiguration`](/zh/docs/reference/config-api/kubelet-config.v1beta1/) 结构体定义了可以通过文件配置的 Kubelet 配置子集,
5240

5341
<!--
5442
The configuration file must be a JSON or YAML representation of the parameters
@@ -60,38 +48,47 @@ Here is an example of what this file might look like:
6048
确保 kubelet 可以读取该文件。
6149

6250
下面是一个 Kubelet 配置文件示例:
63-
64-
```yaml
65-
kind: KubeletConfiguration
51+
```
6652
apiVersion: kubelet.config.k8s.io/v1beta1
53+
kind: KubeletConfiguration
54+
address: "192.168.0.8",
55+
port: 20250,
56+
serializeImagePulls: false,
6757
evictionHard:
6858
memory.available: "200Mi"
6959
```
7060

61+
7162
<!--
72-
In the example, the Kubelet is configured to evict Pods when available memory drops below 200Mi.
63+
In the example, the Kubelet is configured to serve on IP address 192.168.0.8 and port 20250, pull images in parallel,
64+
and evict Pods when available memory drops below 200Mi.
7365
All other Kubelet configuration values are left at their built-in defaults, unless overridden
7466
by flags. Command line flags which target the same value as a config file will override that value.
75-
76-
For a trick to generate a configuration file from a live node, see
77-
[Reconfigure a Node's Kubelet in a Live Cluster](/docs/tasks/administer-cluster/reconfigure-kubelet).
7867
-->
79-
在这个示例中, 当可用内存低于 200Mi 时, kubelet 将会开始驱逐 Pods。
68+
在这个示例中, Kubelet 被设置为在地址 192.168.0.8 端口 20250 上提供服务,以并行方式拖拽镜像,
69+
当可用内存低于 200Mi 时, kubelet 将会开始驱逐 Pods。
8070
没有声明的其余配置项都将使用默认值,除非使用命令行参数来重载。
8171
命令行中的参数将会覆盖配置文件中的对应值。
8272

83-
作为一个小技巧,你可以从活动节点生成配置文件,相关方法请查看
84-
[重新配置活动集群节点的 kubelet](/zh/docs/tasks/administer-cluster/reconfigure-kubelet)。
85-
8673
<!--
8774
## Start a Kubelet process configured via the config file
8875
76+
{{< note >}}
77+
If you use kubeadm to initialize your cluster, use the kubelet-config while creating your cluster with `kubeadmin init`.
78+
See [configuring kubelet using kubeadm](/docs/setup/production-environment/tools/kubeadm/kubelet-integration/) for details.
79+
{{< /note >}}
80+
8981
Start the Kubelet with the `--config` flag set to the path of the Kubelet's config file.
9082
The Kubelet will then load its config from this file.
9183
--->
9284

9385
## 启动通过配置文件配置的 Kubelet 进程
9486

87+
{{< note >}}
88+
如果你使用 kubeadm 初始化你的集群,在使用 `kubeadmin init` 创建你的集群的时候请使用 kubelet-config。
89+
更多细节请阅读[使用 kubeadm 配置 kubelet](/zh/docs/setup/production-environment/tools/kubeadm/kubelet-integration/)
90+
{{< /note >}}
91+
9592
启动 Kubelet 需要将 `--config` 参数设置为 Kubelet 配置文件的路径。Kubelet 将从此文件加载其配置。
9693

9794
<!--
@@ -121,17 +118,12 @@ In the above example, this version is `kubelet.config.k8s.io/v1beta1`.
121118

122119
<!-- discussion -->
123120

124-
<!--
125-
## Relationship to Dynamic Kubelet Config
121+
## {{% heading "whatsnext" %}}
126122

127-
If you are using the [Dynamic Kubelet Configuration](/docs/tasks/administer-cluster/reconfigure-kubelet)
128-
feature, the combination of configuration provided via `--config` and any flags which override these values
129-
is considered the default "last known good" configuration by the automatic rollback mechanism.
123+
<!--
124+
- Learn more about kubelet configuration by checking the
125+
[`KubeletConfiguration`](/docs/reference/config-api/kubelet-config.v1beta1/)
126+
reference.
130127
--->
131-
## 与动态 Kubelet 配置的关系
132-
133-
如果你正在使用[动态 kubelet 配置](/zh/docs/tasks/administer-cluster/reconfigure-kubelet)特性,
134-
那么自动回滚机制将认为通过 `--config` 提供的配置与覆盖这些值的任何参数的组合是
135-
"最后已知正常(last known good)" 的配置。
136-
137-
128+
- 参阅 [`KubeletConfiguration`](/zh/docs/reference/config-api/kubelet-config.v1beta1/)
129+
进一步学习 kubelet 的配置。

content/zh/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ Kubernetes 负责编排和调度 Pod;在每一个节点上,
9999
使用抽象的容器运行时接口,所以你可以任意选用兼容的容器运行时。
100100

101101
<!--
102-
In its earliest releases, Kubernetes offered compatibility with just one container runtime: Docker.
102+
In its earliest releases, Kubernetes offered compatibility with one container runtime: Docker.
103103
Later in the Kubernetes project's history, cluster operators wanted to adopt additional container runtimes.
104104
The CRI was designed to allow this kind of flexibility - and the kubelet began supporting CRI. However,
105105
because Docker existed before the CRI specification was invented, the Kubernetes project created an
106106
adapter component, `dockershim`. The dockershim adapter allows the kubelet to interact with Docker as
107107
if Docker were a CRI compatible runtime.
108108
-->
109-
在早期版本中,Kubernetes 提供的兼容性只支持一个容器运行时:Docker。
109+
在早期版本中,Kubernetes 提供的兼容性支持一个容器运行时:Docker。
110110
在 Kubernetes 发展历史中,集群运营人员希望采用更多的容器运行时。
111111
于是 CRI 被设计出来满足这类灵活性需要 - 而 kubelet 亦开始支持 CRI。
112112
然而,因为 Docker 在 CRI 规范创建之前就已经存在,Kubernetes 就创建了一个适配器组件:`dockershim`
@@ -144,7 +144,7 @@ or execute something inside container using `docker exec`.
144144
<!--
145145
If you're running workloads via Kubernetes, the best way to stop a container is through
146146
the Kubernetes API rather than directly through the container runtime (this advice applies
147-
for all container runtimes, not just Docker).
147+
for all container runtimes, not only Docker).
148148
-->
149149
{{< note >}}
150150

content/zh/docs/tasks/administer-cluster/safely-drain-node.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,39 @@ itself. To attempt an eviction (perhaps more REST-precisely, to attempt to
196196
Pod 的 Eviction 子资源可以看作是一种策略控制的 DELETE 操作,作用于 Pod 本身。
197197
要尝试驱逐(更准确地说,尝试 *创建* 一个 Eviction),需要用 POST 发出所尝试的操作。这里有一个例子:
198198

199+
{{< tabs name="Eviction_example" >}}
200+
{{% tab name="policy/v1" %}}
201+
<!--
202+
{{< note >}}
203+
`policy/v1` Eviction is available in v1.22+. Use `policy/v1beta1` with prior releases.
204+
{{< /note >}}
205+
-->
206+
{{< note >}}
207+
`policy/v1` 驱逐在 v1.22+ 中可用。在之前版本中请使用 `policy/v1beta1`
208+
{{< /note >}}
209+
210+
211+
```json
212+
{
213+
"apiVersion": "policy/v1",
214+
"kind": "Eviction",
215+
"metadata": {
216+
"name": "quux",
217+
"namespace": "default"
218+
}
219+
}
220+
```
221+
{{% /tab %}}
222+
{{% tab name="policy/v1beta1" %}}
223+
<!--
224+
{{< note >}}
225+
Deprecated in v1.22 in favor of `policy/v1`
226+
{{< /note >}}
227+
-->
228+
{{< note >}}
229+
在 v1.22 中已弃用,以 `policy/v1` 取代
230+
{{< /note >}}
231+
199232
```json
200233
{
201234
"apiVersion": "policy/v1beta1",
@@ -206,6 +239,8 @@ Pod 的 Eviction 子资源可以看作是一种策略控制的 DELETE 操作,
206239
}
207240
}
208241
```
242+
{{% /tab %}}
243+
{{< /tabs >}}
209244

210245
<!--
211246
You can attempt an eviction using `curl`:
@@ -219,8 +254,8 @@ curl -v -H 'Content-type: application/json' http://127.0.0.1:8080/api/v1/namespa
219254
<!--
220255
The API can respond in one of three ways:
221256
222-
- If the eviction is granted, then the pod is deleted just as if you had sent
223-
a `DELETE` request to the pod's URL and you get back `200 OK`.
257+
- If the eviction is granted, then the Pod is deleted as if you sent
258+
a `DELETE` request to the Pod's URL and received back `200 OK`.
224259
- If the current state of affairs wouldn't allow an eviction by the rules set
225260
forth in the budget, you get back `429 Too Many Requests`. This is
226261
typically used for generic rate limiting of *any* requests, but here we mean

0 commit comments

Comments
 (0)