1KUBERNETES(1) Jan 2015 KUBERNETES(1)
2
3
4
6 kubectl scale - Set a new size for a Deployment, ReplicaSet, Replica‐
7 tion Controller, or Job
8
9
10
12 kubectl scale [OPTIONS]
13
14
15
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
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|template|go-template|go-tem‐
55 plate-file|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 [
88 ⟨http://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
99 --allow-verification-with-non-compliant-keys=false
100 Allow a SignatureVerifier to use keys which are technically
101 non-compliant with RFC6962.
102
103
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="unix:///var/run/containerd.sock"
160 containerd endpoint
161
162
163 --context=""
164 The name of the kubeconfig context to use
165
166
167 --default-not-ready-toleration-seconds=300
168 Indicates the tolerationSeconds of the toleration for
169 notReady:NoExecute that is added by default to every pod that does not
170 already have such a toleration.
171
172
173 --default-unreachable-toleration-seconds=300
174 Indicates the tolerationSeconds of the toleration for unreach‐
175 able:NoExecute that is added by default to every pod that does not
176 already have such a toleration.
177
178
179 --docker="unix:///var/run/docker.sock"
180 docker endpoint
181
182
183 --docker-env-metadata-whitelist=""
184 a comma-separated list of environment variable keys that needs to
185 be collected for docker containers
186
187
188 --docker-only=false
189 Only report docker containers in addition to root stats
190
191
192 --docker-root="/var/lib/docker"
193 DEPRECATED: docker root is read from docker info (this is a fall‐
194 back, default: /var/lib/docker)
195
196
197 --docker-tls=false
198 use TLS to connect to docker
199
200
201 --docker-tls-ca="ca.pem"
202 path to trusted CA
203
204
205 --docker-tls-cert="cert.pem"
206 path to client certificate
207
208
209 --docker-tls-key="key.pem"
210 path to private key
211
212
213 --enable-load-reader=false
214 Whether to enable cpu load reader
215
216
217 --event-storage-age-limit="default=0"
218 Max length of time for which to store events (per type). Value is a
219 comma separated list of key values, where the keys are event types
220 (e.g.: creation, oom) or "default" and the value is a duration. Default
221 is applied to all non-specified event types
222
223
224 --event-storage-event-limit="default=0"
225 Max number of events to store (per type). Value is a comma sepa‐
226 rated list of key values, where the keys are event types (e.g.: cre‐
227 ation, oom) or "default" and the value is an integer. Default is
228 applied to all non-specified event types
229
230
231 --global-housekeeping-interval=1m0s
232 Interval between global housekeepings
233
234
235 --google-json-key=""
236 The Google Cloud Platform Service Account JSON Key to use for
237 authentication.
238
239
240 --housekeeping-interval=10s
241 Interval between container housekeepings
242
243
244 --insecure-skip-tls-verify=false
245 If true, the server's certificate will not be checked for validity.
246 This will make your HTTPS connections insecure
247
248
249 --kubeconfig=""
250 Path to the kubeconfig file to use for CLI requests.
251
252
253 --log-backtrace-at=:0
254 when logging hits line file:N, emit a stack trace
255
256
257 --log-cadvisor-usage=false
258 Whether to log the usage of the cAdvisor container
259
260
261 --log-dir=""
262 If non-empty, write log files in this directory
263
264
265 --log-flush-frequency=5s
266 Maximum number of seconds between log flushes
267
268
269 --logtostderr=true
270 log to standard error instead of files
271
272
273 --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
274 Comma-separated list of files to check for machine-id. Use the
275 first one that exists.
276
277
278 --match-server-version=false
279 Require server version to match client version
280
281
282 --mesos-agent="127.0.0.1:5051"
283 Mesos agent address
284
285
286 --mesos-agent-timeout=10s
287 Mesos agent timeout
288
289
290 -n, --namespace=""
291 If present, the namespace scope for this CLI request
292
293
294 --request-timeout="0"
295 The length of time to wait before giving up on a single server
296 request. Non-zero values should contain a corresponding time unit (e.g.
297 1s, 2m, 3h). A value of zero means don't timeout requests.
298
299
300 -s, --server=""
301 The address and port of the Kubernetes API server
302
303
304 --stderrthreshold=2
305 logs at or above this threshold go to stderr
306
307
308 --storage-driver-buffer-duration=1m0s
309 Writes in the storage driver will be buffered for this duration,
310 and committed to the non memory backends as a single transaction
311
312
313 --storage-driver-db="cadvisor"
314 database name
315
316
317 --storage-driver-host="localhost:8086"
318 database host:port
319
320
321 --storage-driver-password="root"
322 database password
323
324
325 --storage-driver-secure=false
326 use secure connection with database
327
328
329 --storage-driver-table="stats"
330 table name
331
332
333 --storage-driver-user="root"
334 database username
335
336
337 --token=""
338 Bearer token for authentication to the API server
339
340
341 --user=""
342 The name of the kubeconfig user to use
343
344
345 -v, --v=0
346 log level for V logs
347
348
349 --version=false
350 Print version information and quit
351
352
353 --vmodule=
354 comma-separated list of pattern=N settings for file-filtered log‐
355 ging
356
357
358
360 # Scale a replicaset named 'foo' to 3.
361 kubectl scale --replicas=3 rs/foo
362
363 # Scale a resource identified by type and name specified in "foo.yaml" to 3.
364 kubectl scale --replicas=3 -f foo.yaml
365
366 # If the deployment named mysql's current size is 2, scale mysql to 3.
367 kubectl scale --current-replicas=2 --replicas=3 deployment/mysql
368
369 # Scale multiple replication controllers.
370 kubectl scale --replicas=5 rc/foo rc/bar rc/baz
371
372 # Scale statefulset named 'web' to 3.
373 kubectl scale --replicas=3 statefulset/web
374
375
376
377
379 kubectl(1),
380
381
382
384 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
385 com) based on the kubernetes source material, but hopefully they have
386 been automatically generated since!
387
388
389
390Eric Paris kubernetes User Manuals KUBERNETES(1)