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

NAME

6       kubectl autoscale - Auto-scale a Deployment, ReplicaSet, or
7       ReplicationController
8
9
10

SYNOPSIS

12       kubectl autoscale [OPTIONS]
13
14
15

DESCRIPTION

17       Creates an autoscaler that automatically chooses and sets the number of
18       pods that run in a kubernetes cluster.
19
20
21       Looks up a Deployment, ReplicaSet, StatefulSet, or
22       ReplicationController by name and creates an autoscaler that uses the
23       given resource as a reference. An autoscaler can automatically increase
24       or decrease number of pods deployed within the system as needed.
25
26
27

OPTIONS

29       --allow-missing-template-keys=true
30           If true, ignore any errors in templates when a field or map key is
31       missing in the template. Only applies to golang and jsonpath output
32       formats.
33
34
35       --cpu-percent=-1
36           The target average CPU utilization (represented as a percent of
37       requested CPU) over all the pods. If it's not specified or negative, a
38       default autoscaling policy will be used.
39
40
41       --dry-run="none"
42           Must be "none", "server", or "client". If client strategy, only
43       print the object that would be sent, without sending it. If server
44       strategy, submit server-side request without persisting the resource.
45
46
47       -f, --filename=[]
48           Filename, directory, or URL to files identifying the resource to
49       autoscale.
50
51
52       --generator="horizontalpodautoscaler/v1"
53           The name of the API generator to use. Currently there is only 1
54       generator.
55
56
57       -k, --kustomize=""
58           Process the kustomization directory. This flag can't be used
59       together with -f or -R.
60
61
62       --max=-1
63           The upper limit for the number of pods that can be set by the
64       autoscaler. Required.
65
66
67       --min=-1
68           The lower limit for the number of pods that can be set by the
69       autoscaler. If it's not specified or negative, the server will apply a
70       default value.
71
72
73       --name=""
74           The name for the newly created object. If not specified, the name
75       of the input resource will be used.
76
77
78       -o, --output=""
79           Output format. One of:
80       json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-file.
81
82
83       --record=false
84           Record current kubectl command in the resource annotation. If set
85       to false, do not record the command. If set to true, record the
86       command. If not set, default to updating the existing annotation value
87       only if one already exists.
88
89
90       -R, --recursive=false
91           Process the directory used in -f, --filename recursively. Useful
92       when you want to manage related manifests organized within the same
93       directory.
94
95
96       --save-config=false
97           If true, the configuration of current object will be saved in its
98       annotation. Otherwise, the annotation will be unchanged. This flag is
99       useful when you want to perform kubectl apply on this object in the
100       future.
101
102
103       --template=""
104           Template string or path to template file to use when
105       -o=go-template, -o=go-template-file. The template format is golang
106       templates [ ⟨http://golang.org/pkg/text/template/#pkg-overview⟩].
107
108
109

OPTIONS INHERITED FROM PARENT COMMANDS

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

EXAMPLE

413                # Auto scale a deployment "foo", with the number of pods between 2 and 10, no target CPU utilization specified so a default autoscaling policy will be used:
414                kubectl autoscale deployment foo --min=2 --max=10
415
416                # Auto scale a replication controller "foo", with the number of pods between 1 and 5, target CPU utilization at 80%:
417                kubectl autoscale rc foo --max=5 --cpu-percent=80
418
419
420
421

SEE ALSO

423       kubectl(1),
424
425
426

HISTORY

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