1KUBERNETES(1)(kubernetes) KUBERNETES(1)(kubernetes)
2
3
4
5Eric Paris Jan 2015
6
7
9 kubectl scale - Set a new size for a Deployment, ReplicaSet or Replica‐
10 tion Controller
11
12
13
15 kubectl scale [OPTIONS]
16
17
18
20 Set a new size for a Deployment, ReplicaSet, Replication Controller, or
21 StatefulSet.
22
23
24 Scale also allows users to specify one or more preconditions for the
25 scale action.
26
27
28 If --current-replicas or --resource-version is specified, it is vali‐
29 dated before the scale is attempted, and it is guaranteed that the pre‐
30 condition holds true when the scale is sent to the server.
31
32
33
35 --all=false Select all resources in the namespace of the specified
36 resource types
37
38
39 --allow-missing-template-keys=true If true, ignore any errors in
40 templates when a field or map key is missing in the template. Only ap‐
41 plies to golang and jsonpath output formats.
42
43
44 --current-replicas=-1 Precondition for current size. Requires that
45 the current size of the resource match this value in order to scale.
46
47
48 --dry-run="none" Must be "none", "server", or "client". If client
49 strategy, only print the object that would be sent, without sending it.
50 If server strategy, submit server-side request without persisting the
51 resource.
52
53
54 -f, --filename=[] Filename, directory, or URL to files identifying
55 the resource to set a new size
56
57
58 -k, --kustomize="" Process the kustomization directory. This flag
59 can't be used together with -f or -R.
60
61
62 -o, --output="" Output format. One of: json|yaml|name|go-tem‐
63 plate|go-template-file|template|templatefile|jsonpath|json‐
64 path-as-json|jsonpath-file.
65
66
67 --record=false Record current kubectl command in the resource an‐
68 notation. If set to false, do not record the command. If set to true,
69 record the command. If not set, default to updating the existing anno‐
70 tation value only if one already exists.
71
72
73 -R, --recursive=false Process the directory used in -f, --filename
74 recursively. Useful when you want to manage related manifests organized
75 within the same directory.
76
77
78 --replicas=0 The new desired number of replicas. Required.
79
80
81 --resource-version="" Precondition for resource version. Requires
82 that the current resource version match this value in order to scale.
83
84
85 -l, --selector="" Selector (label query) to filter on, supports
86 '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
87
88
89 --show-managed-fields=false If true, keep the managedFields when
90 printing objects in JSON or YAML format.
91
92
93 --template="" Template string or path to template file to use when
94 -o=go-template, -o=go-template-file. The template format is golang tem‐
95 plates [http://golang.org/pkg/text/template/#pkg-overview].
96
97
98 --timeout=0s The length of time to wait before giving up on a
99 scale operation, zero means don't wait. Any other values should contain
100 a corresponding time unit (e.g. 1s, 2m, 3h).
101
102
103
105 --add-dir-header=false If true, adds the file directory to the
106 header of the log messages
107
108
109 --alsologtostderr=false log to standard error as well as files
110
111
112 --application-metrics-count-limit=100 Max number of application
113 metrics to store (per container)
114
115
116 --as="" Username to impersonate for the operation
117
118
119 --as-group=[] Group to impersonate for the operation, this flag
120 can be repeated to specify multiple groups.
121
122
123 --azure-container-registry-config="" Path to the file containing
124 Azure container registry configuration information.
125
126
127 --boot-id-file="/proc/sys/kernel/random/boot_id" Comma-separated
128 list of files to check for boot-id. Use the first one that exists.
129
130
131 --cache-dir="/builddir/.kube/cache" Default cache directory
132
133
134 --certificate-authority="" Path to a cert file for the certificate
135 authority
136
137
138 --client-certificate="" Path to a client certificate file for TLS
139
140
141 --client-key="" Path to a client key file for TLS
142
143
144 --cloud-provider-gce-l7lb-src-cidrs=130.211.0.0/22,35.191.0.0/16
145 CIDRs opened in GCE firewall for L7 LB traffic proxy health
146 checks
147
148
149 --cloud-provider-gce-lb-src-cidrs=130.211.0.0/22,209.85.152.0/22,209.85.204.0/22,35.191.0.0/16
150 CIDRs opened in GCE firewall for L4 LB traffic proxy health
151 checks
152
153
154 --cluster="" The name of the kubeconfig cluster to use
155
156
157 --container-hints="/etc/cadvisor/container_hints.json" location of
158 the container hints file
159
160
161 --containerd="/run/containerd/containerd.sock" containerd endpoint
162
163
164 --containerd-namespace="k8s.io" containerd namespace
165
166
167 --context="" The name of the kubeconfig context to use
168
169
170 --default-not-ready-toleration-seconds=300 Indicates the tolera‐
171 tionSeconds of the toleration for notReady:NoExecute that is added by
172 default to every pod that does not already have such a toleration.
173
174
175 --default-unreachable-toleration-seconds=300 Indicates the tolera‐
176 tionSeconds of the toleration for unreachable:NoExecute that is added
177 by default to every pod that does not already have such a toleration.
178
179
180 --disable-root-cgroup-stats=false Disable collecting root Cgroup
181 stats
182
183
184 --docker="unix:///var/run/docker.sock" docker endpoint
185
186
187 --docker-env-metadata-whitelist="" a comma-separated list of envi‐
188 ronment variable keys matched with specified prefix that needs to be
189 collected for docker containers
190
191
192 --docker-only=false Only report docker containers in addition to
193 root stats
194
195
196 --docker-root="/var/lib/docker" DEPRECATED: docker root is read
197 from docker info (this is a fallback, default: /var/lib/docker)
198
199
200 --docker-tls=false use TLS to connect to docker
201
202
203 --docker-tls-ca="ca.pem" path to trusted CA
204
205
206 --docker-tls-cert="cert.pem" path to client certificate
207
208
209 --docker-tls-key="key.pem" path to private key
210
211
212 --enable-load-reader=false Whether to enable cpu load reader
213
214
215 --event-storage-age-limit="default=0" Max length of time for which
216 to store events (per type). Value is a comma separated list of key val‐
217 ues, where the keys are event types (e.g.: creation, oom) or "default"
218 and the value is a duration. Default is applied to all non-specified
219 event types
220
221
222 --event-storage-event-limit="default=0" Max number of events to
223 store (per type). Value is a comma separated list of key values, where
224 the keys are event types (e.g.: creation, oom) or "default" and the
225 value is an integer. Default is applied to all non-specified event
226 types
227
228
229 --global-housekeeping-interval=1m0s Interval between global house‐
230 keepings
231
232
233 --housekeeping-interval=10s Interval between container housekeep‐
234 ings
235
236
237 --insecure-skip-tls-verify=false If true, the server's certificate
238 will not be checked for validity. This will make your HTTPS connections
239 insecure
240
241
242 --kubeconfig="" Path to the kubeconfig file to use for CLI re‐
243 quests.
244
245
246 --log-backtrace-at=:0 when logging hits line file:N, emit a stack
247 trace
248
249
250 --log-cadvisor-usage=false Whether to log the usage of the cAdvi‐
251 sor container
252
253
254 --log-dir="" If non-empty, write log files in this directory
255
256
257 --log-file="" If non-empty, use this log file
258
259
260 --log-file-max-size=1800 Defines the maximum size a log file can
261 grow to. Unit is megabytes. If the value is 0, the maximum file size is
262 unlimited.
263
264
265 --log-flush-frequency=5s Maximum number of seconds between log
266 flushes
267
268
269 --logtostderr=true log to standard error instead of files
270
271
272 --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
273 Comma-separated list of files to check for machine-id. Use the
274 first one that exists.
275
276
277 --match-server-version=false Require server version to match
278 client version
279
280
281 -n, --namespace="" If present, the namespace scope for this CLI
282 request
283
284
285 --one-output=false If true, only write logs to their native sever‐
286 ity level (vs also writing to each lower severity level)
287
288
289 --password="" Password for basic authentication to the API server
290
291
292 --profile="none" Name of profile to capture. One of
293 (none|cpu|heap|goroutine|threadcreate|block|mutex)
294
295
296 --profile-output="profile.pprof" Name of the file to write the
297 profile to
298
299
300 --referenced-reset-interval=0 Reset interval for referenced bytes
301 (container_referenced_bytes metric), number of measurement cycles after
302 which referenced bytes are cleared, if set to 0 referenced bytes are
303 never cleared (default: 0)
304
305
306 --request-timeout="0" The length of time to wait before giving up
307 on a single server request. Non-zero values should contain a corre‐
308 sponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't time‐
309 out requests.
310
311
312 -s, --server="" The address and port of the Kubernetes API server
313
314
315 --skip-headers=false If true, avoid header prefixes in the log
316 messages
317
318
319 --skip-log-headers=false If true, avoid headers when opening log
320 files
321
322
323 --stderrthreshold=2 logs at or above this threshold go to stderr
324
325
326 --storage-driver-buffer-duration=1m0s Writes in the storage driver
327 will be buffered for this duration, and committed to the non memory
328 backends as a single transaction
329
330
331 --storage-driver-db="cadvisor" database name
332
333
334 --storage-driver-host="localhost:8086" database host:port
335
336
337 --storage-driver-password="root" database password
338
339
340 --storage-driver-secure=false use secure connection with database
341
342
343 --storage-driver-table="stats" table name
344
345
346 --storage-driver-user="root" database username
347
348
349 --tls-server-name="" Server name to use for server certificate
350 validation. If it is not provided, the hostname used to contact the
351 server is used
352
353
354 --token="" Bearer token for authentication to the API server
355
356
357 --update-machine-info-interval=5m0s Interval between machine info
358 updates.
359
360
361 --user="" The name of the kubeconfig user to use
362
363
364 --username="" Username for basic authentication to the API server
365
366
367 -v, --v=0 number for the log level verbosity
368
369
370 --version=false Print version information and quit
371
372
373 --vmodule= comma-separated list of pattern=N settings for
374 file-filtered logging
375
376
377 --warnings-as-errors=false Treat warnings received from the server
378 as errors and exit with a non-zero exit code
379
380
381
383 # Scale a replicaset named 'foo' to 3.
384 kubectl scale --replicas=3 rs/foo
385
386 # Scale a resource identified by type and name specified in "foo.yaml" to 3.
387 kubectl scale --replicas=3 -f foo.yaml
388
389 # If the deployment named mysql's current size is 2, scale mysql to 3.
390 kubectl scale --current-replicas=2 --replicas=3 deployment/mysql
391
392 # Scale multiple replication controllers.
393 kubectl scale --replicas=5 rc/foo rc/bar rc/baz
394
395 # Scale statefulset named 'web' to 3.
396 kubectl scale --replicas=3 statefulset/web
397
398
399
400
402 kubectl(1),
403
404
405
407 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
408 com) based on the kubernetes source material, but hopefully they have
409 been automatically generated since!
410
411
412
413Manuals User KUBERNETES(1)(kubernetes)