@@ -36,11 +36,20 @@ kubectl scale [--resource-version=version] [--current-replicas=count] --replicas
36
36
37
37
<!--
38
38
```
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
44
53
```
45
54
-->
46
55
``` shell
@@ -62,7 +71,7 @@ kubectl scale --replicas=3 statefulset/web
62
71
63
72
## {{% heading "options" %}}
64
73
65
- <table style =" width : 100% ; table-layout : fixed ;" >
74
+ <table style =" width : 100% ; table-layout : fixed ;" >
66
75
<colgroup >
67
76
<col span =" 1 " style =" width : 10px ;" />
68
77
<col span =" 1 " />
@@ -78,7 +87,8 @@ kubectl scale --replicas=3 statefulset/web
78
87
Select all resources in the namespace of the specified resource types
79
88
-->
80
89
选择指定资源类型的命名空间中的所有资源。
81
- </p ></td >
90
+ </p >
91
+ </td >
82
92
</tr >
83
93
84
94
<tr >
@@ -91,7 +101,8 @@ If true, ignore any errors in templates when a field or map key is missing in th
91
101
-->
92
102
如果为 true,在模板中字段或映射键缺失时忽略模板中的错误。
93
103
仅适用于 golang 和 jsonpath 输出格式。
94
- </p ></td >
104
+ </p >
105
+ </td >
95
106
</tr >
96
107
97
108
<tr >
@@ -104,7 +115,8 @@ Precondition for current size. Requires that the current size of the resource ma
104
115
-->
105
116
当前副本数的前提条件。要求资源的当前副本数与此值匹配才能进行扩缩容。
106
117
默认值 -1 表示没有条件。
107
- </p ></td >
118
+ </p >
119
+ </td >
108
120
</tr >
109
121
110
122
<tr >
@@ -129,7 +141,8 @@ Must be "none", "server", or "client". If client s
129
141
Filename, directory, or URL to files identifying the resource to set a new size
130
142
-->
131
143
文件名、目录或文件 URL 的列表,用于标识要设置新副本数的资源。
132
- </p ></td >
144
+ </p >
145
+ </td >
133
146
</tr >
134
147
135
148
<tr >
@@ -141,7 +154,8 @@ Filename, directory, or URL to files identifying the resource to set a new size
141
154
help for scale
142
155
-->
143
156
scale 操作的帮助命令。
144
- </p ></td >
157
+ </p >
158
+ </td >
145
159
</tr >
146
160
147
161
<tr >
@@ -153,7 +167,8 @@ scale 操作的帮助命令。
153
167
Process the kustomization directory. This flag can't be used together with -f or -R.
154
168
-->
155
169
处理 kustomization 目录。此标志不能与 -f 或 -R 一起使用。
156
- </p ></td >
170
+ </p >
171
+ </td >
157
172
</tr >
158
173
159
174
<tr >
@@ -166,7 +181,8 @@ Output format. One of: (json, yaml, name, go-template, go-template-file, templat
166
181
-->
167
182
输出格式。可选值为:
168
183
json、yaml、name、go-template、go-template-file、template、templatefile、jsonpath、jsonpath-as-json、jsonpath-file。
169
- </p ></td >
184
+ </p >
185
+ </td >
170
186
</tr >
171
187
172
188
<tr >
@@ -178,7 +194,8 @@ json、yaml、name、go-template、go-template-file、template、templatefile、
178
194
Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
179
195
-->
180
196
递归处理在 -f、--filename 中给出的目录。当你想要管理位于同一目录中的相关清单时很有用。
181
- </p ></td >
197
+ </p >
198
+ </td >
182
199
</tr >
183
200
184
201
<tr >
@@ -190,7 +207,8 @@ Process the directory used in -f, --filename recursively. Useful when you want t
190
207
The new desired number of replicas. Required.
191
208
-->
192
209
期望新的副本数。必需。
193
- </p ></td >
210
+ </p >
211
+ </td >
194
212
</tr >
195
213
196
214
<tr >
@@ -202,7 +220,8 @@ The new desired number of replicas. Required.
202
220
Precondition for resource version. Requires that the current resource version match this value in order to scale.
203
221
-->
204
222
资源版本的前提条件。要求当前资源版本与此值匹配才能进行扩缩容。
205
- </p ></td >
223
+ </p >
224
+ </td >
206
225
</tr >
207
226
208
227
<tr >
@@ -211,11 +230,13 @@ Precondition for resource version. Requires that the current resource version ma
211
230
<tr >
212
231
<td ></td ><td style =" line-height : 130% ; word-wrap : break-word ;" ><p >
213
232
<!--
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.
215
234
-->
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 >
219
240
</tr >
220
241
221
242
<tr >
@@ -240,7 +261,8 @@ Template string or path to template file to use when -o=go-template, -o=go-templ
240
261
-->
241
262
当 -o=go-template、-o=go-template-file 时使用的模板字符串或模板文件路径。
242
263
模板格式为 golang 模板 [ http://golang.org/pkg/text/template/#pkg-overview ] 。
243
- </p ></td >
264
+ </p >
265
+ </td >
244
266
</tr >
245
267
246
268
<tr >
@@ -253,15 +275,16 @@ The length of time to wait before giving up on a scale operation, zero means don
253
275
-->
254
276
等待放弃扩缩容操作之前的时长,零表示不等待。
255
277
其他值应包含相应的时间单位(例如 1s、2m、3h)。
256
- </p ></td >
278
+ </p >
279
+ </td >
257
280
</tr >
258
281
259
282
</tbody >
260
283
</table >
261
284
262
285
## {{% heading "parentoptions" %}}
263
286
264
- <table style =" width : 100% ; table-layout : fixed ;" >
287
+ <table style =" width : 100% ; table-layout : fixed ;" >
265
288
<colgroup >
266
289
<col span =" 1 " style =" width : 10px ;" />
267
290
<col span =" 1 " />
0 commit comments