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

NAME

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

EXAMPLE

389                # Scale a replicaset named 'foo' to 3.
390                kubectl scale --replicas=3 rs/foo
391
392                # Scale a resource identified by type and name specified in "foo.yaml" to 3.
393                kubectl scale --replicas=3 -f foo.yaml
394
395                # If the deployment named mysql's current size is 2, scale mysql to 3.
396                kubectl scale --current-replicas=2 --replicas=3 deployment/mysql
397
398                # Scale multiple replication controllers.
399                kubectl scale --replicas=5 rc/foo rc/bar rc/baz
400
401                # Scale statefulset named 'web' to 3.
402                kubectl scale --replicas=3 statefulset/web
403
404
405
406

SEE ALSO

408       kubectl(1),
409
410
411

HISTORY

413       January 2015, Originally compiled by Eric Paris (eparis at  redhat  dot
414       com)  based  on the kubernetes source material, but hopefully they have
415       been automatically generated since!
416
417
418
419Eric Paris                  kubernetes User Manuals              KUBERNETES(1)
Impressum