Skip to content

Commit 616294a

Browse files
authored
Merge pull request #44929 from windsonsea/dnshor
[zh] Sync configure-upgrade-etcd.md and dns-horizontal-autoscaling.md
2 parents 9cb970b + c8833fd commit 616294a

File tree

2 files changed

+51
-55
lines changed

2 files changed

+51
-55
lines changed

content/zh-cn/docs/tasks/administer-cluster/configure-upgrade-etcd.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -609,39 +609,39 @@ etcd 支持从 [major.minor](http://semver.org/) 或其他不同 patch 版本的
609609
Before starting the restore operation, a snapshot file must be present. It can
610610
either be a snapshot file from a previous backup operation, or from a remaining
611611
[data directory](https://etcd.io/docs/current/op-guide/configuration/#--data-dir).
612-
Here is an example:
613612
-->
614613
在启动还原操作之前,必须有一个快照文件。它可以是来自以前备份操作的快照文件,
615614
也可以是来自剩余[数据目录](https://etcd.io/docs/current/op-guide/configuration/#--data-dir)的快照文件。
616-
例如:
617-
618-
```shell
619-
ETCDCTL_API=3 etcdctl --endpoints 10.2.0.9:2379 snapshot restore snapshot.db
620-
```
621615

622616
<!--
623-
Another example for restoring using `etcdctl` options:
617+
When restoring the cluster, use the `--data-dir` option to specify to which folder the cluster should be restored:
624618
-->
625-
恢复时使用 `etcdctl` 选项的另一个示例:
619+
在恢复集群时,使用 `--data-dir` 选项来指定集群应被恢复到哪个文件夹。
626620

627621
```shell
628-
ETCDCTL_API=3 etcdctl snapshot restore --data-dir <data-dir-location> snapshot.db
622+
ETCDCTL_API=3 etcdctl --data-dir <data-dir-location> snapshot restore snapshot.db
629623
```
630624

631625
<!--
632626
where `<data-dir-location>` is a directory that will be created during the restore process.
633627
634-
Yet another example would be to first export the `ETCDCTL_API` environment variable
628+
Yet another example would be to first export the `ETCDCTL_API` environment variable:
635629
-->
636630
其中 `<data-dir-location>` 是将在恢复过程中创建的目录。
637631

638632
另一个例子是先导出 `ETCDCTL_API` 环境变量:
639633

640634
```shell
641635
export ETCDCTL_API=3
642-
etcdctl snapshot restore --data-dir <data-dir-location> snapshot.db
636+
etcdctl --data-dir <data-dir-location> snapshot restore snapshot.db
643637
```
644638

639+
<!--
640+
If `<data-dir-location>` is the same folder as before, delete it and stop etcd process before restoring the cluster. Else change etcd configuration and restart the etcd process after restoration to make it use the new data directory.
641+
-->
642+
如果 `<data-dir-location>` 与之前的文件夹相同,请先删除此文件夹并停止 etcd 进程,再恢复集群。
643+
否则,需要在恢复后更改 etcd 配置并重新启动 etcd 进程才能使用新的数据目录。
644+
645645
<!--
646646
For more information and examples on restoring a cluster from a snapshot file, see
647647
[etcd disaster recovery documentation](https://etcd.io/docs/current/op-guide/recovery/#restoring-a-cluster).

content/zh-cn/docs/tasks/administer-cluster/dns-horizontal-autoscaling.md

Lines changed: 40 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ your Kubernetes cluster.
2929

3030
* 确保 [Kubernetes DNS](/zh-cn/docs/concepts/services-networking/dns-pod-service/) 已启用。
3131

32-
3332
<!-- steps -->
3433

3534
<!--
@@ -38,7 +37,7 @@ your Kubernetes cluster.
3837
List the {{< glossary_tooltip text="Deployments" term_id="deployment" >}}
3938
in your cluster in the kube-system {{< glossary_tooltip text="namespace" term_id="namespace" >}}:
4039
-->
41-
## 确定是否 DNS 水平自动扩缩特性已经启用 {#determining-whether-dns-horizontal-autoscaling-is-already-enabled}
40+
## 确定是否 DNS 水平自动扩缩特性已经启用 {#determining-whether-dns-horizontal-autoscaling-is-already-enabled}
4241

4342
在 kube-system {{< glossary_tooltip text="命名空间" term_id="namespace" >}}中列出集群中的
4443
{{< glossary_tooltip text="Deployment" term_id="deployment" >}}:
@@ -53,26 +52,26 @@ The output is similar to this:
5352
输出类似如下这样:
5453

5554
```
56-
NAME READY UP-TO-DATE AVAILABLE AGE
55+
NAME READY UP-TO-DATE AVAILABLE AGE
5756
...
58-
dns-autoscaler 1/1 1 1 ...
57+
kube-dns-autoscaler 1/1 1 1 ...
5958
...
6059
```
6160

6261
<!--
63-
If you see "dns-autoscaler" in the output, DNS horizontal autoscaling is
62+
If you see "kube-dns-autoscaler" in the output, DNS horizontal autoscaling is
6463
already enabled, and you can skip to
6564
[Tuning autoscaling parameters](#tuning-autoscaling-parameters).
6665
-->
67-
如果在输出中看到 “dns-autoscaler”,说明 DNS 水平自动扩缩已经启用,
66+
如果在输出中看到 “kube-dns-autoscaler”,说明 DNS 水平自动扩缩已经启用,
6867
可以跳到[调优 DNS 自动扩缩参数](#tuning-autoscaling-parameters)
6968

7069
<!--
7170
## Get the name of your DNS Deployment {#find-scaling-target}
7271
7372
List the DNS deployments in your cluster in the kube-system namespace:
7473
-->
75-
## 获取 DNS Deployment 的名称 {#find-scaling-target}
74+
## 获取 DNS Deployment 的名称 {#find-scaling-target}
7675

7776
列出集群内 kube-system 命名空间中的 DNS Deployment:
7877

@@ -122,12 +121,12 @@ the name of your Deployment for DNS is coredns, your scale target is Deployment/
122121
其中 `<your-deployment-name>` 是 DNS Deployment 的名称。
123122
例如,如果你的 DNS Deployment 名称是 `coredns`,则你的扩展目标是 Deployment/coredns。
124123

124+
{{< note >}}
125125
<!--
126126
CoreDNS is the default DNS service for Kubernetes. CoreDNS sets the label
127127
`k8s-app=kube-dns` so that it can work in clusters that originally used
128128
kube-dns.
129129
-->
130-
{{< note >}}
131130
CoreDNS 是 Kubernetes 的默认 DNS 服务。CoreDNS 设置标签 `k8s-app=kube-dns`
132131
以便能够在原来使用 `kube-dns` 的集群中工作。
133132
{{< /note >}}
@@ -155,7 +154,7 @@ In the file, replace `<SCALE_TARGET>` with your scale target.
155154
Go to the directory that contains your configuration file, and enter this
156155
command to create the Deployment:
157156
-->
158-
在文件中,将 `<SCALE_TARGET>` 替换成扩缩目标。
157+
在此文件中,将 `<SCALE_TARGET>` 替换成扩缩目标。
159158

160159
进入到包含配置文件的目录中,输入如下命令创建 Deployment:
161160

@@ -166,25 +165,25 @@ kubectl apply -f dns-horizontal-autoscaler.yaml
166165
<!--
167166
The output of a successful command is:
168167
-->
169-
一个成功的命令输出是
168+
命令成功执行后的输出为
170169

171170
```
172-
deployment.apps/dns-autoscaler created
171+
deployment.apps/kube-dns-autoscaler created
173172
```
174173

175174
<!--
176175
DNS horizontal autoscaling is now enabled.
177176
-->
178-
DNS 水平自动扩缩在已经启用了
177+
DNS 水平自动扩缩现在已经启用了
179178

180179
<!--
181180
## Tune DNS autoscaling parameters {#tuning-autoscaling-parameters}
182181
183-
Verify that the dns-autoscaler {{< glossary_tooltip text="ConfigMap" term_id="configmap" >}} exists:
182+
Verify that the kube-dns-autoscaler {{< glossary_tooltip text="ConfigMap" term_id="configmap" >}} exists:
184183
-->
185184
## 调优 DNS 自动扩缩参数 {#tuning-autoscaling-parameters}
186185

187-
验证 dns-autoscaler {{< glossary_tooltip text="ConfigMap" term_id="configmap" >}} 是否存在:
186+
验证 kube-dns-autoscaler {{< glossary_tooltip text="ConfigMap" term_id="configmap" >}} 是否存在:
188187

189188
```shell
190189
kubectl get configmap --namespace=kube-system
@@ -198,17 +197,17 @@ The output is similar to this:
198197
```
199198
NAME DATA AGE
200199
...
201-
dns-autoscaler 1 ...
200+
kube-dns-autoscaler 1 ...
202201
...
203202
```
204203

205204
<!--
206205
Modify the data in the ConfigMap:
207206
-->
208-
修改该 ConfigMap 中的数据:
207+
修改此 ConfigMap 中的数据:
209208

210209
```shell
211-
kubectl edit configmap dns-autoscaler --namespace=kube-system
210+
kubectl edit configmap kube-dns-autoscaler --namespace=kube-system
212211
```
213212

214213
<!--
@@ -225,7 +224,6 @@ Modify the fields according to your needs. The "min" field indicates the
225224
minimal number of DNS backends. The actual number of backends is
226225
calculated using this equation:
227226
-->
228-
229227
根据需要修改对应的字段。“min” 字段表明 DNS 后端的最小数量。
230228
实际后端的数量通过使用如下公式来计算:
231229
@@ -258,21 +256,21 @@ There are other supported scaling patterns. For details, see
258256
There are a few options for tuning DNS horizontal autoscaling. Which option to
259257
use depends on different conditions.
260258
-->
261-
## 禁用 DNS 水平自动扩缩
259+
## 禁用 DNS 水平自动扩缩 {#disable-dns-horizontal-autoscaling}
262260

263261
有几个可供调优的 DNS 水平自动扩缩选项。具体使用哪个选项因环境而异。
264262

265263
<!--
266-
### Option 1: Scale down the dns-autoscaler deployment to 0 replicas
264+
### Option 1: Scale down the kube-dns-autoscaler deployment to 0 replicas
267265
268266
This option works for all situations. Enter this command:
269267
-->
270-
### 选项 1:缩容 dns-autoscaler Deployment 0 个副本
268+
### 选项 1:kube-dns-autoscaler Deployment 缩容至 0 个副本
271269

272-
该选项适用于所有场景。运行如下命令:
270+
此选项适用于所有场景。运行如下命令:
273271

274272
```shell
275-
kubectl scale deployment --replicas=0 dns-autoscaler --namespace=kube-system
273+
kubectl scale deployment --replicas=0 kube-dns-autoscaler --namespace=kube-system
276274
```
277275

278276
<!--
@@ -281,7 +279,7 @@ The output is:
281279
输出如下所示:
282280

283281
```
284-
deployment.apps/dns-autoscaler scaled
282+
deployment.apps/kube-dns-autoscaler scaled
285283
```
286284

287285
<!--
@@ -301,22 +299,22 @@ The output displays 0 in the DESIRED and CURRENT columns:
301299
```
302300
NAME DESIRED CURRENT READY AGE
303301
...
304-
dns-autoscaler-6b59789fc8 0 0 0 ...
302+
kube-dns-autoscaler-6b59789fc8 0 0 0 ...
305303
...
306304
```
307305

308306
<!--
309-
### Option 2: Delete the dns-autoscaler deployment
307+
### Option 2: Delete the kube-dns-autoscaler deployment
310308
311-
This option works if dns-autoscaler is under your own control, which means
309+
This option works if kube-dns-autoscaler is under your own control, which means
312310
no one will re-create it:
313311
-->
314-
### 选项 2:删除 dns-autoscaler Deployment
312+
### 选项 2:删除 kube-dns-autoscaler Deployment
315313

316-
如果 dns-autoscaler 为你所控制,也就说没有人会去重新创建它,可以选择此选项:
314+
如果 kube-dns-autoscaler 为你所控制,也就说没有人会去重新创建它,可以选择此选项:
317315

318316
```shell
319-
kubectl delete deployment dns-autoscaler --namespace=kube-system
317+
kubectl delete deployment kube-dns-autoscaler --namespace=kube-system
320318
```
321319

322320
<!--
@@ -325,38 +323,37 @@ The output is:
325323
输出内容如下所示:
326324

327325
```
328-
deployment.apps "dns-autoscaler" deleted
326+
deployment.apps "kube-dns-autoscaler" deleted
329327
```
330328

331329
<!--
332-
### Option 3: Delete the dns-autoscaler manifest file from the master node
330+
### Option 3: Delete the kube-dns-autoscaler manifest file from the master node
333331
334-
This option works if dns-autoscaler is under control of the (deprecated)
332+
This option works if kube-dns-autoscaler is under control of the (deprecated)
335333
[Addon Manager](https://git.k8s.io/kubernetes/cluster/addons/README.md),
336334
and you have write access to the master node.
337335
-->
336+
### 选项 3:从主控节点删除 kube-dns-autoscaler 清单文件
338337

339-
### 选项 3:从主控节点删除 dns-autoscaler 清单文件
340-
341-
如果 dns-autoscaler 在[插件管理器](https://git.k8s.io/kubernetes/cluster/addons/README.md)
342-
的控制之下,并且具有操作 master 节点的写权限,可以使用此选项。
338+
如果 kube-dns-autoscaler 在[插件管理器](https://git.k8s.io/kubernetes/cluster/addons/README.md)
339+
的控制之下,并且具有操作主控节点的写权限,可以使用此选项。
343340

344341
<!--
345342
Sign in to the master node and delete the corresponding manifest file.
346-
The common path for this dns-autoscaler is:
343+
The common path for this kube-dns-autoscaler is:
347344
-->
348-
登录到主控节点,删除对应的清单文件。
349-
dns-autoscaler 对应的路径一般为:
345+
登录到主控节点,删除对应的清单文件。
346+
kube-dns-autoscaler 对应的路径一般为:
350347

351348
```
352349
/etc/kubernetes/addons/dns-horizontal-autoscaler/dns-horizontal-autoscaler.yaml
353350
```
354351

355352
<!--
356353
After the manifest file is deleted, the Addon Manager will delete the
357-
dns-autoscaler Deployment.
354+
kube-dns-autoscaler Deployment.
358355
-->
359-
当清单文件被删除后,插件管理器将删除 dns-autoscaler Deployment。
356+
当清单文件被删除后,插件管理器将删除 kube-dns-autoscaler Deployment。
360357

361358
<!-- discussion -->
362359

@@ -369,7 +366,7 @@ the DNS service.
369366
* An autoscaler Pod runs a client that polls the Kubernetes API server for the
370367
number of nodes and cores in the cluster.
371368
-->
372-
## 理解 DNS 水平自动扩缩工作原理
369+
## 理解 DNS 水平自动扩缩工作原理 {#understanding-how-dns-horizontal-autoscaling-works}
373370

374371
* cluster-proportional-autoscaler 应用独立于 DNS 服务部署。
375372

@@ -405,7 +402,6 @@ patterns: *linear* and *ladder*.
405402
* Read about [Guaranteed Scheduling For Critical Add-On Pods](/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/).
406403
* Learn more about the
407404
[implementation of cluster-proportional-autoscaler](https://github.com/kubernetes-sigs/cluster-proportional-autoscaler).
408-
409405
-->
410406
* 阅读[为关键插件 Pod 提供的调度保障](/zh-cn/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/)
411407
* 进一步了解 [cluster-proportional-autoscaler 实现](https://github.com/kubernetes-sigs/cluster-proportional-autoscaler)

0 commit comments

Comments
 (0)