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

NAME

6       kubectl  autoscale  -  Auto-scale a Deployment, ReplicaSet, or Replica‐
7       tionController
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 ReplicationCon‐
22       troller by name and creates an autoscaler that uses the given  resource
23       as  a  reference.  An autoscaler can automatically increase or decrease
24       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=false
42           If true, only print the object that would be sent, without  sending
43       it.
44
45
46       -f, --filename=[]
47           Filename,  directory,  or  URL to files identifying the resource to
48       autoscale.
49
50
51       --generator="horizontalpodautoscaler/v1"
52           The name of the API generator to use. Currently  there  is  only  1
53       generator.
54
55
56       -k, --kustomize=""
57           Process  the  kustomization  directory.  This  flag  can't  be used
58       together with -f or -R.
59
60
61       --max=-1
62           The upper limit for the number of pods  that  can  be  set  by  the
63       autoscaler. Required.
64
65
66       --min=-1
67           The  lower  limit  for  the  number  of pods that can be set by the
68       autoscaler. If it's not specified or negative, the server will apply  a
69       default value.
70
71
72       --name=""
73           The  name  for the newly created object. If not specified, the name
74       of the input resource will be used.
75
76
77       -o, --output=""
78           Output   format.   One    of:    json|yaml|name|go-template|go-tem‐
79       plate-file|template|templatefile|jsonpath|jsonpath-file.
80
81
82       --record=false
83           Record  current  kubectl command in the resource annotation. If set
84       to false, do not record the command. If set to true,  record  the  com‐
85       mand.  If  not  set,  default to updating the existing annotation value
86       only if one already exists.
87
88
89       -R, --recursive=false
90           Process the directory used in -f,  --filename  recursively.  Useful
91       when  you  want  to  manage related manifests organized within the same
92       directory.
93
94
95       --save-config=false
96           If true, the configuration of current object will be saved  in  its
97       annotation.  Otherwise,  the annotation will be unchanged. This flag is
98       useful when you want to perform kubectl apply on  this  object  in  the
99       future.
100
101
102       --template=""
103           Template  string  or  path  to template file to use when -o=go-tem‐
104       plate, -o=go-template-file. The template format is golang  templates  [
105http://golang.org/pkg/text/template/#pkg-overview⟩].
106
107
108

OPTIONS INHERITED FROM PARENT COMMANDS

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

EXAMPLE

395                # 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:
396                kubectl autoscale deployment foo --min=2 --max=10
397
398                # Auto scale a replication controller "foo", with the number of pods between 1 and 5, target CPU utilization at 80%:
399                kubectl autoscale rc foo --max=5 --cpu-percent=80
400
401
402
403

SEE ALSO

405       kubectl(1),
406
407
408

HISTORY

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