@@ -29,7 +29,6 @@ your Kubernetes cluster.
29
29
30
30
* 确保 [ Kubernetes DNS] ( /zh-cn/docs/concepts/services-networking/dns-pod-service/ ) 已启用。
31
31
32
-
33
32
<!-- steps -->
34
33
35
34
<!--
@@ -38,7 +37,7 @@ your Kubernetes cluster.
38
37
List the {{< glossary_tooltip text="Deployments" term_id="deployment" >}}
39
38
in your cluster in the kube-system {{< glossary_tooltip text="namespace" term_id="namespace" >}}:
40
39
-->
41
- ## 确定是否 DNS 水平自动扩缩特性已经启用 {#determining-whether-dns-horizontal-autoscaling-is-already-enabled}
40
+ ## 确定是否 DNS 水平自动扩缩特性已经启用 {#determining-whether-dns-horizontal-autoscaling-is-already-enabled}
42
41
43
42
在 kube-system {{< glossary_tooltip text="命名空间" term_id="namespace" >}}中列出集群中的
44
43
{{< glossary_tooltip text="Deployment" term_id="deployment" >}}:
@@ -53,26 +52,26 @@ The output is similar to this:
53
52
输出类似如下这样:
54
53
55
54
```
56
- NAME READY UP-TO-DATE AVAILABLE AGE
55
+ NAME READY UP-TO-DATE AVAILABLE AGE
57
56
...
58
- dns-autoscaler 1/1 1 1 ...
57
+ kube- dns-autoscaler 1/1 1 1 ...
59
58
...
60
59
```
61
60
62
61
<!--
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
64
63
already enabled, and you can skip to
65
64
[Tuning autoscaling parameters](#tuning-autoscaling-parameters).
66
65
-->
67
- 如果在输出中看到 “dns-autoscaler”,说明 DNS 水平自动扩缩已经启用,
66
+ 如果在输出中看到 “kube- dns-autoscaler”,说明 DNS 水平自动扩缩已经启用,
68
67
可以跳到[ 调优 DNS 自动扩缩参数] ( #tuning-autoscaling-parameters ) 。
69
68
70
69
<!--
71
70
## Get the name of your DNS Deployment {#find-scaling-target}
72
71
73
72
List the DNS deployments in your cluster in the kube-system namespace:
74
73
-->
75
- ## 获取 DNS Deployment 的名称 {#find-scaling-target}
74
+ ## 获取 DNS Deployment 的名称 {#find-scaling-target}
76
75
77
76
列出集群内 kube-system 命名空间中的 DNS Deployment:
78
77
@@ -122,12 +121,12 @@ the name of your Deployment for DNS is coredns, your scale target is Deployment/
122
121
其中 ` <your-deployment-name> ` 是 DNS Deployment 的名称。
123
122
例如,如果你的 DNS Deployment 名称是 ` coredns ` ,则你的扩展目标是 Deployment/coredns。
124
123
124
+ {{< note >}}
125
125
<!--
126
126
CoreDNS is the default DNS service for Kubernetes. CoreDNS sets the label
127
127
`k8s-app=kube-dns` so that it can work in clusters that originally used
128
128
kube-dns.
129
129
-->
130
- {{< note >}}
131
130
CoreDNS 是 Kubernetes 的默认 DNS 服务。CoreDNS 设置标签 ` k8s-app=kube-dns ` ,
132
131
以便能够在原来使用 ` kube-dns ` 的集群中工作。
133
132
{{< /note >}}
@@ -155,7 +154,7 @@ In the file, replace `<SCALE_TARGET>` with your scale target.
155
154
Go to the directory that contains your configuration file, and enter this
156
155
command to create the Deployment:
157
156
-->
158
- 在文件中 ,将 ` <SCALE_TARGET> ` 替换成扩缩目标。
157
+ 在此文件中 ,将 ` <SCALE_TARGET> ` 替换成扩缩目标。
159
158
160
159
进入到包含配置文件的目录中,输入如下命令创建 Deployment:
161
160
@@ -166,25 +165,25 @@ kubectl apply -f dns-horizontal-autoscaler.yaml
166
165
<!--
167
166
The output of a successful command is:
168
167
-->
169
- 一个成功的命令输出是 :
168
+ 命令成功执行后的输出为 :
170
169
171
170
```
172
- deployment.apps/dns-autoscaler created
171
+ deployment.apps/kube- dns-autoscaler created
173
172
```
174
173
175
174
<!--
176
175
DNS horizontal autoscaling is now enabled.
177
176
-->
178
- DNS 水平自动扩缩在已经启用了 。
177
+ DNS 水平自动扩缩现在已经启用了 。
179
178
180
179
<!--
181
180
## Tune DNS autoscaling parameters {#tuning-autoscaling-parameters}
182
181
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:
184
183
-->
185
184
## 调优 DNS 自动扩缩参数 {#tuning-autoscaling-parameters}
186
185
187
- 验证 dns-autoscaler {{< glossary_tooltip text="ConfigMap" term_id="configmap" >}} 是否存在:
186
+ 验证 kube- dns-autoscaler {{< glossary_tooltip text="ConfigMap" term_id="configmap" >}} 是否存在:
188
187
189
188
``` shell
190
189
kubectl get configmap --namespace=kube-system
@@ -198,17 +197,17 @@ The output is similar to this:
198
197
```
199
198
NAME DATA AGE
200
199
...
201
- dns-autoscaler 1 ...
200
+ kube- dns-autoscaler 1 ...
202
201
...
203
202
```
204
203
205
204
<!--
206
205
Modify the data in the ConfigMap:
207
206
-->
208
- 修改该 ConfigMap 中的数据:
207
+ 修改此 ConfigMap 中的数据:
209
208
210
209
``` shell
211
- kubectl edit configmap dns-autoscaler --namespace=kube-system
210
+ kubectl edit configmap kube- dns-autoscaler --namespace=kube-system
212
211
```
213
212
214
213
<!--
@@ -225,7 +224,6 @@ Modify the fields according to your needs. The "min" field indicates the
225
224
minimal number of DNS backends. The actual number of backends is
226
225
calculated using this equation:
227
226
-->
228
-
229
227
根据需要修改对应的字段。“min” 字段表明 DNS 后端的最小数量。
230
228
实际后端的数量通过使用如下公式来计算:
231
229
@@ -258,21 +256,21 @@ There are other supported scaling patterns. For details, see
258
256
There are a few options for tuning DNS horizontal autoscaling. Which option to
259
257
use depends on different conditions.
260
258
-->
261
- ## 禁用 DNS 水平自动扩缩
259
+ ## 禁用 DNS 水平自动扩缩 {#disable-dns-horizontal-autoscaling}
262
260
263
261
有几个可供调优的 DNS 水平自动扩缩选项。具体使用哪个选项因环境而异。
264
262
265
263
<!--
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
267
265
268
266
This option works for all situations. Enter this command:
269
267
-->
270
- ### 选项 1:缩容 dns-autoscaler Deployment 至 0 个副本
268
+ ### 选项 1:kube- dns-autoscaler Deployment 缩容至 0 个副本
271
269
272
- 该选项适用于所有场景 。运行如下命令:
270
+ 此选项适用于所有场景 。运行如下命令:
273
271
274
272
``` shell
275
- kubectl scale deployment --replicas=0 dns-autoscaler --namespace=kube-system
273
+ kubectl scale deployment --replicas=0 kube- dns-autoscaler --namespace=kube-system
276
274
```
277
275
278
276
<!--
@@ -281,7 +279,7 @@ The output is:
281
279
输出如下所示:
282
280
283
281
```
284
- deployment.apps/dns-autoscaler scaled
282
+ deployment.apps/kube- dns-autoscaler scaled
285
283
```
286
284
287
285
<!--
@@ -301,22 +299,22 @@ The output displays 0 in the DESIRED and CURRENT columns:
301
299
```
302
300
NAME DESIRED CURRENT READY AGE
303
301
...
304
- dns-autoscaler-6b59789fc8 0 0 0 ...
302
+ kube- dns-autoscaler-6b59789fc8 0 0 0 ...
305
303
...
306
304
```
307
305
308
306
<!--
309
- ### Option 2: Delete the dns-autoscaler deployment
307
+ ### Option 2: Delete the kube- dns-autoscaler deployment
310
308
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
312
310
no one will re-create it:
313
311
-->
314
- ### 选项 2:删除 dns-autoscaler Deployment
312
+ ### 选项 2:删除 kube- dns-autoscaler Deployment
315
313
316
- 如果 dns-autoscaler 为你所控制,也就说没有人会去重新创建它,可以选择此选项:
314
+ 如果 kube- dns-autoscaler 为你所控制,也就说没有人会去重新创建它,可以选择此选项:
317
315
318
316
``` shell
319
- kubectl delete deployment dns-autoscaler --namespace=kube-system
317
+ kubectl delete deployment kube- dns-autoscaler --namespace=kube-system
320
318
```
321
319
322
320
<!--
@@ -325,38 +323,37 @@ The output is:
325
323
输出内容如下所示:
326
324
327
325
```
328
- deployment.apps "dns-autoscaler" deleted
326
+ deployment.apps "kube- dns-autoscaler" deleted
329
327
```
330
328
331
329
<!--
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
333
331
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)
335
333
[Addon Manager](https://git.k8s.io/kubernetes/cluster/addons/README.md),
336
334
and you have write access to the master node.
337
335
-->
336
+ ### 选项 3:从主控节点删除 kube-dns-autoscaler 清单文件
338
337
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
+ 的控制之下,并且具有操作主控节点的写权限,可以使用此选项。
343
340
344
341
<!--
345
342
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:
347
344
-->
348
- 登录到主控节点,删除对应的清单文件。
349
- dns-autoscaler 对应的路径一般为:
345
+ 登录到主控节点,删除对应的清单文件。
346
+ kube- dns-autoscaler 对应的路径一般为:
350
347
351
348
```
352
349
/etc/kubernetes/addons/dns-horizontal-autoscaler/dns-horizontal-autoscaler.yaml
353
350
```
354
351
355
352
<!--
356
353
After the manifest file is deleted, the Addon Manager will delete the
357
- dns-autoscaler Deployment.
354
+ kube- dns-autoscaler Deployment.
358
355
-->
359
- 当清单文件被删除后,插件管理器将删除 dns-autoscaler Deployment。
356
+ 当清单文件被删除后,插件管理器将删除 kube- dns-autoscaler Deployment。
360
357
361
358
<!-- discussion -->
362
359
@@ -369,7 +366,7 @@ the DNS service.
369
366
* An autoscaler Pod runs a client that polls the Kubernetes API server for the
370
367
number of nodes and cores in the cluster.
371
368
-->
372
- ## 理解 DNS 水平自动扩缩工作原理
369
+ ## 理解 DNS 水平自动扩缩工作原理 {#understanding-how-dns-horizontal-autoscaling-works}
373
370
374
371
* cluster-proportional-autoscaler 应用独立于 DNS 服务部署。
375
372
@@ -405,7 +402,6 @@ patterns: *linear* and *ladder*.
405
402
* Read about [Guaranteed Scheduling For Critical Add-On Pods](/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/).
406
403
* Learn more about the
407
404
[implementation of cluster-proportional-autoscaler](https://github.com/kubernetes-sigs/cluster-proportional-autoscaler).
408
-
409
405
-->
410
406
* 阅读[ 为关键插件 Pod 提供的调度保障] ( /zh-cn/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/ ) 。
411
407
* 进一步了解 [ cluster-proportional-autoscaler 实现] ( https://github.com/kubernetes-sigs/cluster-proportional-autoscaler ) 。
0 commit comments