1KUBERNETES(1)(kubernetes)                            KUBERNETES(1)(kubernetes)
2
3
4
5Eric Paris Jan 2015
6
7

NAME

9       kubectl scale - Set a new size for a Deployment, ReplicaSet or Replica‐
10       tion Controller
11
12
13

SYNOPSIS

15       kubectl scale [OPTIONS]
16
17
18

DESCRIPTION

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

OPTIONS

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       --template=""      Template string or path to template file to use when
90       -o=go-template, -o=go-template-file. The template format is golang tem‐
91       plates [http://golang.org/pkg/text/template/#pkg-overview].
92
93
94       --timeout=0s      The length of time to wait  before  giving  up  on  a
95       scale operation, zero means don't wait. Any other values should contain
96       a corresponding time unit (e.g. 1s, 2m, 3h).
97
98
99

OPTIONS INHERITED FROM PARENT COMMANDS

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

EXAMPLE

379                # Scale a replicaset named 'foo' to 3.
380                kubectl scale --replicas=3 rs/foo
381
382                # Scale a resource identified by type and name specified in "foo.yaml" to 3.
383                kubectl scale --replicas=3 -f foo.yaml
384
385                # If the deployment named mysql's current size is 2, scale mysql to 3.
386                kubectl scale --current-replicas=2 --replicas=3 deployment/mysql
387
388                # Scale multiple replication controllers.
389                kubectl scale --replicas=5 rc/foo rc/bar rc/baz
390
391                # Scale statefulset named 'web' to 3.
392                kubectl scale --replicas=3 statefulset/web
393
394
395
396

SEE ALSO

398       kubectl(1),
399
400
401

HISTORY

403       January 2015, Originally compiled by Eric Paris (eparis at  redhat  dot
404       com)  based  on the kubernetes source material, but hopefully they have
405       been automatically generated since!
406
407
408
409Manuals                              User            KUBERNETES(1)(kubernetes)
Impressum