Skip to content

Commit de653f5

Browse files
authored
Merge pull request #51530 from my-git9/npa-1020
[zh-cn]sync kubectl_scale kubectl_taint
2 parents 8edd2f2 + c9d98e7 commit de653f5

File tree

2 files changed

+75
-43
lines changed
  • content/zh-cn/docs/reference/kubectl/generated

2 files changed

+75
-43
lines changed

content/zh-cn/docs/reference/kubectl/generated/kubectl_scale/_index.md

Lines changed: 46 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,20 @@ kubectl scale [--resource-version=version] [--current-replicas=count] --replicas
3636

3737
<!--
3838
```
39-
# Scale a replica set named 'foo' to 3
40-
# Scale a resource identified by type and name specified in "foo.yaml" to 3
41-
# If the deployment named mysql's current size is 2, scale mysql to 3
42-
# Scale multiple replication controllers
43-
# Scale stateful set named 'web' to 3
39+
# Scale a replica set named 'foo' to 3
40+
kubectl scale --replicas=3 rs/foo
41+
42+
# Scale a resource identified by type and name specified in "foo.yaml" to 3
43+
kubectl scale --replicas=3 -f foo.yaml
44+
45+
# If the deployment named mysql's current size is 2, scale mysql to 3
46+
kubectl scale --current-replicas=2 --replicas=3 deployment/mysql
47+
48+
# Scale multiple replication controllers
49+
kubectl scale --replicas=5 rc/example1 rc/example2 rc/example3
50+
51+
# Scale stateful set named 'web' to 3
52+
kubectl scale --replicas=3 statefulset/web
4453
```
4554
-->
4655
```shell
@@ -62,7 +71,7 @@ kubectl scale --replicas=3 statefulset/web
6271

6372
## {{% heading "options" %}}
6473

65-
<table style="width: 100%; table-layout: fixed;">
74+
<table style="width: 100%; table-layout: fixed;">
6675
<colgroup>
6776
<col span="1" style="width: 10px;" />
6877
<col span="1" />
@@ -78,7 +87,8 @@ kubectl scale --replicas=3 statefulset/web
7887
Select all resources in the namespace of the specified resource types
7988
-->
8089
选择指定资源类型的命名空间中的所有资源。
81-
</p></td>
90+
</p>
91+
</td>
8292
</tr>
8393

8494
<tr>
@@ -91,7 +101,8 @@ If true, ignore any errors in templates when a field or map key is missing in th
91101
-->
92102
如果为 true,在模板中字段或映射键缺失时忽略模板中的错误。
93103
仅适用于 golang 和 jsonpath 输出格式。
94-
</p></td>
104+
</p>
105+
</td>
95106
</tr>
96107

97108
<tr>
@@ -104,7 +115,8 @@ Precondition for current size. Requires that the current size of the resource ma
104115
-->
105116
当前副本数的前提条件。要求资源的当前副本数与此值匹配才能进行扩缩容。
106117
默认值 -1 表示没有条件。
107-
</p></td>
118+
</p>
119+
</td>
108120
</tr>
109121

110122
<tr>
@@ -129,7 +141,8 @@ Must be &quot;none&quot;, &quot;server&quot;, or &quot;client&quot;. If client s
129141
Filename, directory, or URL to files identifying the resource to set a new size
130142
-->
131143
文件名、目录或文件 URL 的列表,用于标识要设置新副本数的资源。
132-
</p></td>
144+
</p>
145+
</td>
133146
</tr>
134147

135148
<tr>
@@ -141,7 +154,8 @@ Filename, directory, or URL to files identifying the resource to set a new size
141154
help for scale
142155
-->
143156
scale 操作的帮助命令。
144-
</p></td>
157+
</p>
158+
</td>
145159
</tr>
146160

147161
<tr>
@@ -153,7 +167,8 @@ scale 操作的帮助命令。
153167
Process the kustomization directory. This flag can't be used together with -f or -R.
154168
-->
155169
处理 kustomization 目录。此标志不能与 -f 或 -R 一起使用。
156-
</p></td>
170+
</p>
171+
</td>
157172
</tr>
158173

159174
<tr>
@@ -166,7 +181,8 @@ Output format. One of: (json, yaml, name, go-template, go-template-file, templat
166181
-->
167182
输出格式。可选值为:
168183
json、yaml、name、go-template、go-template-file、template、templatefile、jsonpath、jsonpath-as-json、jsonpath-file。
169-
</p></td>
184+
</p>
185+
</td>
170186
</tr>
171187

172188
<tr>
@@ -178,7 +194,8 @@ json、yaml、name、go-template、go-template-file、template、templatefile、
178194
Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
179195
-->
180196
递归处理在 -f、--filename 中给出的目录。当你想要管理位于同一目录中的相关清单时很有用。
181-
</p></td>
197+
</p>
198+
</td>
182199
</tr>
183200

184201
<tr>
@@ -190,7 +207,8 @@ Process the directory used in -f, --filename recursively. Useful when you want t
190207
The new desired number of replicas. Required.
191208
-->
192209
期望新的副本数。必需。
193-
</p></td>
210+
</p>
211+
</td>
194212
</tr>
195213

196214
<tr>
@@ -202,7 +220,8 @@ The new desired number of replicas. Required.
202220
Precondition for resource version. Requires that the current resource version match this value in order to scale.
203221
-->
204222
资源版本的前提条件。要求当前资源版本与此值匹配才能进行扩缩容。
205-
</p></td>
223+
</p>
224+
</td>
206225
</tr>
207226

208227
<tr>
@@ -211,11 +230,13 @@ Precondition for resource version. Requires that the current resource version ma
211230
<tr>
212231
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
213232
<!--
214-
Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching objects must satisfy all of the specified label constraints.
233+
Selector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objects must satisfy all of the specified label constraints.
215234
-->
216-
过滤所用的选择算符(标签查询),支持 '='、'==' 和 '!='。
217-
(例如 -l key1=value1,key2=value2)。匹配的对象必须满足所有指定的标签约束。
218-
</p></td>
235+
过滤所用的选择算符(标签查询),支持 '='、'=='、'!='、'in' 和 'notin'。
236+
(例如 <code>-l key1=value1,key2=value2,key3 in (value3)</code>)。
237+
匹配的对象必须满足所有指定的标签约束。
238+
</p>
239+
</td>
219240
</tr>
220241

221242
<tr>
@@ -240,7 +261,8 @@ Template string or path to template file to use when -o=go-template, -o=go-templ
240261
-->
241262
当 -o=go-template、-o=go-template-file 时使用的模板字符串或模板文件路径。
242263
模板格式为 golang 模板 [http://golang.org/pkg/text/template/#pkg-overview]
243-
</p></td>
264+
</p>
265+
</td>
244266
</tr>
245267

246268
<tr>
@@ -253,15 +275,16 @@ The length of time to wait before giving up on a scale operation, zero means don
253275
-->
254276
等待放弃扩缩容操作之前的时长,零表示不等待。
255277
其他值应包含相应的时间单位(例如 1s、2m、3h)。
256-
</p></td>
278+
</p>
279+
</td>
257280
</tr>
258281

259282
</tbody>
260283
</table>
261284

262285
## {{% heading "parentoptions" %}}
263286

264-
<table style="width: 100%; table-layout: fixed;">
287+
<table style="width: 100%; table-layout: fixed;">
265288
<colgroup>
266289
<col span="1" style="width: 10px;" />
267290
<col span="1" />

content/zh-cn/docs/reference/kubectl/generated/kubectl_taint/_index.md

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,33 +40,40 @@ kubectl taint NODE NAME KEY_1=VAL_1:TAINT_EFFECT_1 ... KEY_N=VAL_N:TAINT_EFFECT_
4040
## {{% heading "examples" %}}
4141

4242
<!--
43+
```shell
4344
# Update node 'foo' with a taint with key 'dedicated' and value 'special-user' and effect 'NoSchedule'
4445
# If a taint with that key and effect already exists, its value is replaced as specified
46+
kubectl taint nodes foo dedicated=special-user:NoSchedule
4547
4648
# Remove from node 'foo' the taint with key 'dedicated' and effect 'NoSchedule' if one exists
49+
kubectl taint nodes foo dedicated:NoSchedule-
4750
4851
# Remove from node 'foo' all the taints with key 'dedicated'
52+
kubectl taint nodes foo dedicated-
4953
5054
# Add a taint with key 'dedicated' on nodes having label myLabel=X
55+
kubectl taint node -l myLabel=X dedicated=foo:PreferNoSchedule
5156
5257
# Add to node 'foo' a taint with key 'bar' and no value
53-
-->
58+
kubectl taint nodes foo bar:NoSchedule
5459
```
55-
# 使用带有键为 "dedicated" 和值为 "special-user" 以及效果为 "NoSchedule" 的污点来更新节点 "foo"
56-
# 如果具有该键和效果的污点已经存在,则其值将按指定方式替换
57-
kubectl taint nodes foo dedicated=special-user:NoSchedule
58-
59-
# 从节点 "foo" 中删除键为 "dedicated" 且效果为 "NoSchedule" 的污点(如果存在)
60-
kubectl taint nodes foo dedicated:NoSchedule-
61-
62-
# 从节点 "foo" 中删除所有带有键为 "dedicated" 的污点
63-
kubectl taint nodes foo dedicated-
64-
65-
# 在标签为 myLabel=X 的节点上添加键为 'dedicated' 的污点
66-
kubectl taint node -l myLabel=X dedicated=foo:PreferNoSchedule
67-
68-
# 向节点 "foo" 添加一个带有键 "bar" 且没有值的污点
69-
kubectl taint nodes foo bar:NoSchedule
60+
-->
61+
```shell
62+
# 使用带有键为 "dedicated" 和值为 "special-user" 以及效果为 "NoSchedule" 的污点来更新节点 "foo"
63+
# 如果具有该键和效果的污点已经存在,则其值将按指定方式替换
64+
kubectl taint nodes foo dedicated=special-user:NoSchedule
65+
66+
# 从节点 "foo" 中删除键为 "dedicated" 且效果为 "NoSchedule" 的污点(如果存在)
67+
kubectl taint nodes foo dedicated:NoSchedule-
68+
69+
# 从节点 "foo" 中删除所有带有键为 "dedicated" 的污点
70+
kubectl taint nodes foo dedicated-
71+
72+
# 在标签为 myLabel=X 的节点上添加键为 'dedicated' 的污点
73+
kubectl taint node -l myLabel=X dedicated=foo:PreferNoSchedule
74+
75+
# 向节点 "foo" 添加一个带有键 "bar" 且没有值的污点
76+
kubectl taint nodes foo bar:NoSchedule
7077
```
7178

7279
## {{% heading "options" %}}
@@ -87,7 +94,8 @@ kubectl taint NODE NAME KEY_1=VAL_1:TAINT_EFFECT_1 ... KEY_N=VAL_N:TAINT_EFFECT_
8794
Select all nodes in the cluster
8895
-->
8996
选择集群中的所有节点
90-
</p></td>
97+
</p>
98+
</td>
9199
</tr>
92100

93101
<tr>
@@ -184,9 +192,10 @@ If true, allow taints to be overwritten, otherwise reject taint updates that ove
184192
<td></td><td style="line-height: 130%; word-wrap: break-word;">
185193
<p>
186194
<!--
187-
Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching objects must satisfy all of the specified label constraints.
195+
Selector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objects must satisfy all of the specified label constraints.
188196
-->
189-
用来执行过滤的选择算符(标签查询),支持 '='、'==' 和 '!='(例如 -l key1=value1,key2=value2)。
197+
过滤所用的选择算符(标签查询),支持 '='、'=='、'!='、'in' 和 'notin'。
198+
(例如 <code>-l key1=value1,key2=value2,key3 in (value3)</code>)。
190199
匹配的对象必须满足所有指定的标签约束。
191200
</p>
192201
</td>
@@ -303,7 +312,7 @@ UID to impersonate for the operation.
303312
</tr>
304313

305314
<tr>
306-
<td colspan="2">--cache-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "$HOME/.kube/cache"</td>
315+
<td colspan="2">--cache-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default: "$HOME/.kube/cache"-->默认值:"$HOME/.kube/cache"</td>
307316
</tr>
308317
<tr>
309318
<td></td><td style="line-height: 130%; word-wrap: break-word;">

0 commit comments

Comments
 (0)