1KUBERNETES(1)                      Jan 2015                      KUBERNETES(1)
2
3
4

NAME

6       kubectl scale - Set a new size for a Deployment, ReplicaSet or
7       Replication Controller
8
9
10

SYNOPSIS

12       kubectl scale [OPTIONS]
13
14
15

DESCRIPTION

17       Set a new size for a Deployment, ReplicaSet, Replication Controller, or
18       StatefulSet.
19
20
21       Scale also allows users to specify one or more preconditions for the
22       scale action.
23
24
25       If --current-replicas or --resource-version is specified, it is
26       validated before the scale is attempted, and it is guaranteed that the
27       precondition holds true when the scale is sent to the server.
28
29
30

OPTIONS

32       --all=false
33           Select all resources in the namespace of the specified resource
34       types
35
36
37       --allow-missing-template-keys=true
38           If true, ignore any errors in templates when a field or map key is
39       missing in the template. Only applies to golang and jsonpath output
40       formats.
41
42
43       --current-replicas=-1
44           Precondition for current size. Requires that the current size of
45       the resource match this value in order to scale.
46
47
48       -f, --filename=[]
49           Filename, directory, or URL to files identifying the resource to
50       set a new size
51
52
53       -k, --kustomize=""
54           Process the kustomization directory. This flag can't be used
55       together with -f or -R.
56
57
58       -o, --output=""
59           Output format. One of:
60       json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-file.
61
62
63       --record=false
64           Record current kubectl command in the resource annotation. If set
65       to false, do not record the command. If set to true, record the
66       command. If not set, default to updating the existing annotation value
67       only if one already exists.
68
69
70       -R, --recursive=false
71           Process the directory used in -f, --filename recursively. Useful
72       when you want to manage related manifests organized within the same
73       directory.
74
75
76       --replicas=0
77           The new desired number of replicas. Required.
78
79
80       --resource-version=""
81           Precondition for resource version. Requires that the current
82       resource version match this value in order to scale.
83
84
85       -l, --selector=""
86           Selector (label query) to filter on, supports '=', '==', and
87       '!='.(e.g. -l key1=value1,key2=value2)
88
89
90       --template=""
91           Template string or path to template file to use when
92       -o=go-template, -o=go-template-file. The template format is golang
93       templates [ ⟨http://golang.org/pkg/text/template/#pkg-overview⟩].
94
95
96       --timeout=0s
97           The length of time to wait before giving up on a scale operation,
98       zero means don't wait. Any other values should contain a corresponding
99       time unit (e.g. 1s, 2m, 3h).
100
101
102

OPTIONS INHERITED FROM PARENT COMMANDS

104       --add-dir-header=false
105           If true, adds the file directory to the header
106
107
108       --alsologtostderr=false
109           log to standard error as well as files
110
111
112       --application-metrics-count-limit=100
113           Max number of application metrics to store (per container)
114
115
116       --as=""
117           Username to impersonate for the operation
118
119
120       --as-group=[]
121           Group to impersonate for the operation, this flag can be repeated
122       to specify multiple groups.
123
124
125       --azure-container-registry-config=""
126           Path to the file containing Azure container registry configuration
127       information.
128
129
130       --boot-id-file="/proc/sys/kernel/random/boot_id"
131           Comma-separated list of files to check for boot-id. Use the first
132       one that exists.
133
134
135       --cache-dir="/builddir/.kube/http-cache"
136           Default HTTP cache directory
137
138
139       --certificate-authority=""
140           Path to a cert file for the certificate authority
141
142
143       --client-certificate=""
144           Path to a client certificate file for TLS
145
146
147       --client-key=""
148           Path to a client key file for TLS
149
150
151       --cloud-provider-gce-l7lb-src-cidrs=130.211.0.0/22,35.191.0.0/16
152           CIDRs opened in GCE firewall for L7 LB traffic proxy  health checks
153
154
155       --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
156           CIDRs opened in GCE firewall for L4 LB traffic proxy  health checks
157
158
159       --cluster=""
160           The name of the kubeconfig cluster to use
161
162
163       --container-hints="/etc/cadvisor/container_hints.json"
164           location of the container hints file
165
166
167       --containerd="/run/containerd/containerd.sock"
168           containerd endpoint
169
170
171       --containerd-namespace="k8s.io"
172           containerd namespace
173
174
175       --context=""
176           The name of the kubeconfig context to use
177
178
179       --default-not-ready-toleration-seconds=300
180           Indicates the tolerationSeconds of the toleration for
181       notReady:NoExecute that is added by default to every pod that does not
182       already have such a toleration.
183
184
185       --default-unreachable-toleration-seconds=300
186           Indicates the tolerationSeconds of the toleration for
187       unreachable:NoExecute that is added by default to every pod that does
188       not already have such a toleration.
189
190
191       --disable-root-cgroup-stats=false
192           Disable collecting root Cgroup stats
193
194
195       --docker="unix:///var/run/docker.sock"
196           docker endpoint
197
198
199       --docker-env-metadata-whitelist=""
200           a comma-separated list of environment variable keys that needs to
201       be collected for docker containers
202
203
204       --docker-only=false
205           Only report docker containers in addition to root stats
206
207
208       --docker-root="/var/lib/docker"
209           DEPRECATED: docker root is read from docker info (this is a
210       fallback, default: /var/lib/docker)
211
212
213       --docker-tls=false
214           use TLS to connect to docker
215
216
217       --docker-tls-ca="ca.pem"
218           path to trusted CA
219
220
221       --docker-tls-cert="cert.pem"
222           path to client certificate
223
224
225       --docker-tls-key="key.pem"
226           path to private key
227
228
229       --enable-load-reader=false
230           Whether to enable cpu load reader
231
232
233       --event-storage-age-limit="default=0"
234           Max length of time for which to store events (per type). Value is a
235       comma separated list of key values, where the keys are event types
236       (e.g.: creation, oom) or "default" and the value is a duration. Default
237       is applied to all non-specified event types
238
239
240       --event-storage-event-limit="default=0"
241           Max number of events to store (per type). Value is a comma
242       separated list of key values, where the keys are event types (e.g.:
243       creation, oom) or "default" and the value is an integer. Default is
244       applied to all non-specified event types
245
246
247       --global-housekeeping-interval=1m0s
248           Interval between global housekeepings
249
250
251       --housekeeping-interval=10s
252           Interval between container housekeepings
253
254
255       --insecure-skip-tls-verify=false
256           If true, the server's certificate will not be checked for validity.
257       This will make your HTTPS connections insecure
258
259
260       --kubeconfig=""
261           Path to the kubeconfig file to use for CLI requests.
262
263
264       --log-backtrace-at=:0
265           when logging hits line file:N, emit a stack trace
266
267
268       --log-cadvisor-usage=false
269           Whether to log the usage of the cAdvisor container
270
271
272       --log-dir=""
273           If non-empty, write log files in this directory
274
275
276       --log-file=""
277           If non-empty, use this log file
278
279
280       --log-file-max-size=1800
281           Defines the maximum size a log file can grow to. Unit is megabytes.
282       If the value is 0, the maximum file size is unlimited.
283
284
285       --log-flush-frequency=5s
286           Maximum number of seconds between log flushes
287
288
289       --logtostderr=true
290           log to standard error instead of files
291
292
293       --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
294           Comma-separated list of files to check for machine-id. Use the
295       first one that exists.
296
297
298       --match-server-version=false
299           Require server version to match client version
300
301
302       -n, --namespace=""
303           If present, the namespace scope for this CLI request
304
305
306       --password=""
307           Password for basic authentication to the API server
308
309
310       --profile="none"
311           Name of profile to capture. One of
312       (none|cpu|heap|goroutine|threadcreate|block|mutex)
313
314
315       --profile-output="profile.pprof"
316           Name of the file to write the profile to
317
318
319       --request-timeout="0"
320           The length of time to wait before giving up on a single server
321       request. Non-zero values should contain a corresponding time unit (e.g.
322       1s, 2m, 3h). A value of zero means don't timeout requests.
323
324
325       -s, --server=""
326           The address and port of the Kubernetes API server
327
328
329       --skip-headers=false
330           If true, avoid header prefixes in the log messages
331
332
333       --skip-log-headers=false
334           If true, avoid headers when opening log files
335
336
337       --stderrthreshold=2
338           logs at or above this threshold go to stderr
339
340
341       --storage-driver-buffer-duration=1m0s
342           Writes in the storage driver will be buffered for this duration,
343       and committed to the non memory backends as a single transaction
344
345
346       --storage-driver-db="cadvisor"
347           database name
348
349
350       --storage-driver-host="localhost:8086"
351           database host:port
352
353
354       --storage-driver-password="root"
355           database password
356
357
358       --storage-driver-secure=false
359           use secure connection with database
360
361
362       --storage-driver-table="stats"
363           table name
364
365
366       --storage-driver-user="root"
367           database username
368
369
370       --tls-server-name=""
371           Server name to use for server certificate validation. If it is not
372       provided, the hostname used to contact the server is used
373
374
375       --token=""
376           Bearer token for authentication to the API server
377
378
379       --update-machine-info-interval=5m0s
380           Interval between machine info updates.
381
382
383       --user=""
384           The name of the kubeconfig user to use
385
386
387       --username=""
388           Username for basic authentication to the API server
389
390
391       -v, --v=0
392           number for the log level verbosity
393
394
395       --version=false
396           Print version information and quit
397
398
399       --vmodule=
400           comma-separated list of pattern=N settings for file-filtered
401       logging
402
403
404

EXAMPLE

406                # Scale a replicaset named 'foo' to 3.
407                kubectl scale --replicas=3 rs/foo
408
409                # Scale a resource identified by type and name specified in "foo.yaml" to 3.
410                kubectl scale --replicas=3 -f foo.yaml
411
412                # If the deployment named mysql's current size is 2, scale mysql to 3.
413                kubectl scale --current-replicas=2 --replicas=3 deployment/mysql
414
415                # Scale multiple replication controllers.
416                kubectl scale --replicas=5 rc/foo rc/bar rc/baz
417
418                # Scale statefulset named 'web' to 3.
419                kubectl scale --replicas=3 statefulset/web
420
421
422
423

SEE ALSO

425       kubectl(1),
426
427
428

HISTORY

430       January 2015, Originally compiled by Eric Paris (eparis at redhat dot
431       com) based on the kubernetes source material, but hopefully they have
432       been automatically generated since!
433
434
435
436Eric Paris                  kubernetes User Manuals              KUBERNETES(1)
Impressum