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       -o, --output=""
54           Output    format.    One   of:   json|yaml|name|go-template|go-tem‐
55       plate-file|template|templatefile|jsonpath|jsonpath-file.
56
57
58       --record=false
59           Record current kubectl command in the resource annotation.  If  set
60       to  false,  do  not record the command. If set to true, record the com‐
61       mand. If not set, default to updating  the  existing  annotation  value
62       only if one already exists.
63
64
65       -R, --recursive=false
66           Process  the  directory  used in -f, --filename recursively. Useful
67       when you want to manage related manifests  organized  within  the  same
68       directory.
69
70
71       --replicas=0
72           The new desired number of replicas. Required.
73
74
75       --resource-version=""
76           Precondition  for  resource  version.  Requires  that  the  current
77       resource version match this value in order to scale.
78
79
80       -l, --selector=""
81           Selector (label query)  to  filter  on,  supports  '=',  '==',  and
82       '!='.(e.g. -l key1=value1,key2=value2)
83
84
85       --template=""
86           Template  string  or  path  to template file to use when -o=go-tem‐
87       plate, -o=go-template-file. The template format is golang  templates  [
88http://golang.org/pkg/text/template/#pkg-overview⟩].
89
90
91       --timeout=0s
92           The  length  of time to wait before giving up on a scale operation,
93       zero means don't wait. Any other values should contain a  corresponding
94       time unit (e.g. 1s, 2m, 3h).
95
96
97

OPTIONS INHERITED FROM PARENT COMMANDS

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

EXAMPLE

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

SEE ALSO

394       kubectl(1),
395
396
397

HISTORY

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