1KUBERNETES(1)(kubernetes) KUBERNETES(1)(kubernetes)
2
3
4
5Eric Paris Jan 2015
6
7
9 kubectl autoscale - Auto-scale a Deployment, ReplicaSet, StatefulSet,
10 or ReplicationController
11
12
13
15 kubectl autoscale [OPTIONS]
16
17
18
20 Creates an autoscaler that automatically chooses and sets the number of
21 pods that run in a kubernetes cluster.
22
23
24 Looks up a Deployment, ReplicaSet, StatefulSet, or ReplicationCon‐
25 troller by name and creates an autoscaler that uses the given resource
26 as a reference. An autoscaler can automatically increase or decrease
27 number of pods deployed within the system as needed.
28
29
30
32 --allow-missing-template-keys=true If true, ignore any errors in
33 templates when a field or map key is missing in the template. Only ap‐
34 plies to golang and jsonpath output formats.
35
36
37 --cpu-percent=-1 The target average CPU utilization (represented
38 as a percent of requested CPU) over all the pods. If it's not specified
39 or negative, a default autoscaling policy will be used.
40
41
42 --dry-run="none" Must be "none", "server", or "client". If client
43 strategy, only print the object that would be sent, without sending it.
44 If server strategy, submit server-side request without persisting the
45 resource.
46
47
48 --field-manager="kubectl-autoscale" Name of the manager used to
49 track field ownership.
50
51
52 -f, --filename=[] Filename, directory, or URL to files identifying
53 the resource to autoscale.
54
55
56 --generator="horizontalpodautoscaler/v1" The name of the API gen‐
57 erator to use. Currently there is only 1 generator.
58
59
60 -k, --kustomize="" Process the kustomization directory. This flag
61 can't be used together with -f or -R.
62
63
64 --max=-1 The upper limit for the number of pods that can be set by
65 the autoscaler. Required.
66
67
68 --min=-1 The lower limit for the number of pods that can be set by
69 the autoscaler. If it's not specified or negative, the server will ap‐
70 ply a default value.
71
72
73 --name="" The name for the newly created object. If not specified,
74 the name of the input resource will be used.
75
76
77 -o, --output="" Output format. One of: json|yaml|name|go-tem‐
78 plate|go-template-file|template|templatefile|jsonpath|json‐
79 path-as-json|jsonpath-file.
80
81
82 --record=false Record current kubectl command in the resource an‐
83 notation. If set to false, do not record the command. If set to true,
84 record the command. If not set, default to updating the existing anno‐
85 tation value only if one already exists.
86
87
88 -R, --recursive=false Process the directory used in -f, --filename
89 recursively. Useful when you want to manage related manifests organized
90 within the same directory.
91
92
93 --save-config=false If true, the configuration of current object
94 will be saved in its annotation. Otherwise, the annotation will be un‐
95 changed. This flag is useful when you want to perform kubectl apply on
96 this object in the future.
97
98
99 --show-managed-fields=false If true, keep the managedFields when
100 printing objects in JSON or YAML format.
101
102
103 --template="" Template string or path to template file to use when
104 -o=go-template, -o=go-template-file. The template format is golang tem‐
105 plates [http://golang.org/pkg/text/template/#pkg-overview].
106
107
108
110 --add-dir-header=false If true, adds the file directory to the
111 header of the log messages
112
113
114 --alsologtostderr=false log to standard error as well as files
115
116
117 --application-metrics-count-limit=100 Max number of application
118 metrics to store (per container)
119
120
121 --as="" Username to impersonate for the operation
122
123
124 --as-group=[] Group to impersonate for the operation, this flag
125 can be repeated to specify multiple groups.
126
127
128 --azure-container-registry-config="" Path to the file containing
129 Azure container registry configuration information.
130
131
132 --boot-id-file="/proc/sys/kernel/random/boot_id" Comma-separated
133 list of files to check for boot-id. Use the first one that exists.
134
135
136 --cache-dir="/builddir/.kube/cache" Default cache directory
137
138
139 --certificate-authority="" Path to a cert file for the certificate
140 authority
141
142
143 --client-certificate="" Path to a client certificate file for TLS
144
145
146 --client-key="" Path to a client key file for TLS
147
148
149 --cloud-provider-gce-l7lb-src-cidrs=130.211.0.0/22,35.191.0.0/16
150 CIDRs opened in GCE firewall for L7 LB traffic proxy health
151 checks
152
153
154 --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
155 CIDRs opened in GCE firewall for L4 LB traffic proxy health
156 checks
157
158
159 --cluster="" The name of the kubeconfig cluster to use
160
161
162 --container-hints="/etc/cadvisor/container_hints.json" location of
163 the container hints file
164
165
166 --containerd="/run/containerd/containerd.sock" containerd endpoint
167
168
169 --containerd-namespace="k8s.io" containerd namespace
170
171
172 --context="" The name of the kubeconfig context to use
173
174
175 --default-not-ready-toleration-seconds=300 Indicates the tolera‐
176 tionSeconds of the toleration for notReady:NoExecute that is added by
177 default to every pod that does not already have such a toleration.
178
179
180 --default-unreachable-toleration-seconds=300 Indicates the tolera‐
181 tionSeconds of the toleration for unreachable:NoExecute that is added
182 by default to every pod that does not already have such a toleration.
183
184
185 --disable-root-cgroup-stats=false Disable collecting root Cgroup
186 stats
187
188
189 --docker="unix:///var/run/docker.sock" docker endpoint
190
191
192 --docker-env-metadata-whitelist="" a comma-separated list of envi‐
193 ronment variable keys matched with specified prefix that needs to be
194 collected for docker containers
195
196
197 --docker-only=false Only report docker containers in addition to
198 root stats
199
200
201 --docker-root="/var/lib/docker" DEPRECATED: docker root is read
202 from docker info (this is a fallback, default: /var/lib/docker)
203
204
205 --docker-tls=false use TLS to connect to docker
206
207
208 --docker-tls-ca="ca.pem" path to trusted CA
209
210
211 --docker-tls-cert="cert.pem" path to client certificate
212
213
214 --docker-tls-key="key.pem" path to private key
215
216
217 --enable-load-reader=false Whether to enable cpu load reader
218
219
220 --event-storage-age-limit="default=0" Max length of time for which
221 to store events (per type). Value is a comma separated list of key val‐
222 ues, where the keys are event types (e.g.: creation, oom) or "default"
223 and the value is a duration. Default is applied to all non-specified
224 event types
225
226
227 --event-storage-event-limit="default=0" Max number of events to
228 store (per type). Value is a comma separated list of key values, where
229 the keys are event types (e.g.: creation, oom) or "default" and the
230 value is an integer. Default is applied to all non-specified event
231 types
232
233
234 --global-housekeeping-interval=1m0s Interval between global house‐
235 keepings
236
237
238 --housekeeping-interval=10s Interval between container housekeep‐
239 ings
240
241
242 --insecure-skip-tls-verify=false If true, the server's certificate
243 will not be checked for validity. This will make your HTTPS connections
244 insecure
245
246
247 --kubeconfig="" Path to the kubeconfig file to use for CLI re‐
248 quests.
249
250
251 --log-backtrace-at=:0 when logging hits line file:N, emit a stack
252 trace
253
254
255 --log-cadvisor-usage=false Whether to log the usage of the cAdvi‐
256 sor container
257
258
259 --log-dir="" If non-empty, write log files in this directory
260
261
262 --log-file="" If non-empty, use this log file
263
264
265 --log-file-max-size=1800 Defines the maximum size a log file can
266 grow to. Unit is megabytes. If the value is 0, the maximum file size is
267 unlimited.
268
269
270 --log-flush-frequency=5s Maximum number of seconds between log
271 flushes
272
273
274 --logtostderr=true log to standard error instead of files
275
276
277 --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
278 Comma-separated list of files to check for machine-id. Use the
279 first one that exists.
280
281
282 --match-server-version=false Require server version to match
283 client version
284
285
286 -n, --namespace="" If present, the namespace scope for this CLI
287 request
288
289
290 --one-output=false If true, only write logs to their native sever‐
291 ity level (vs also writing to each lower severity level)
292
293
294 --password="" Password for basic authentication to the API server
295
296
297 --profile="none" Name of profile to capture. One of
298 (none|cpu|heap|goroutine|threadcreate|block|mutex)
299
300
301 --profile-output="profile.pprof" Name of the file to write the
302 profile to
303
304
305 --referenced-reset-interval=0 Reset interval for referenced bytes
306 (container_referenced_bytes metric), number of measurement cycles after
307 which referenced bytes are cleared, if set to 0 referenced bytes are
308 never cleared (default: 0)
309
310
311 --request-timeout="0" The length of time to wait before giving up
312 on a single server request. Non-zero values should contain a corre‐
313 sponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't time‐
314 out requests.
315
316
317 -s, --server="" The address and port of the Kubernetes API server
318
319
320 --skip-headers=false If true, avoid header prefixes in the log
321 messages
322
323
324 --skip-log-headers=false If true, avoid headers when opening log
325 files
326
327
328 --stderrthreshold=2 logs at or above this threshold go to stderr
329
330
331 --storage-driver-buffer-duration=1m0s Writes in the storage driver
332 will be buffered for this duration, and committed to the non memory
333 backends as a single transaction
334
335
336 --storage-driver-db="cadvisor" database name
337
338
339 --storage-driver-host="localhost:8086" database host:port
340
341
342 --storage-driver-password="root" database password
343
344
345 --storage-driver-secure=false use secure connection with database
346
347
348 --storage-driver-table="stats" table name
349
350
351 --storage-driver-user="root" database username
352
353
354 --tls-server-name="" Server name to use for server certificate
355 validation. If it is not provided, the hostname used to contact the
356 server is used
357
358
359 --token="" Bearer token for authentication to the API server
360
361
362 --update-machine-info-interval=5m0s Interval between machine info
363 updates.
364
365
366 --user="" The name of the kubeconfig user to use
367
368
369 --username="" Username for basic authentication to the API server
370
371
372 -v, --v=0 number for the log level verbosity
373
374
375 --version=false Print version information and quit
376
377
378 --vmodule= comma-separated list of pattern=N settings for
379 file-filtered logging
380
381
382 --warnings-as-errors=false Treat warnings received from the server
383 as errors and exit with a non-zero exit code
384
385
386
388 # 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:
389 kubectl autoscale deployment foo --min=2 --max=10
390
391 # Auto scale a replication controller "foo", with the number of pods between 1 and 5, target CPU utilization at 80%:
392 kubectl autoscale rc foo --max=5 --cpu-percent=80
393
394
395
396
398 kubectl(1),
399
400
401
403 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
404 com) based on the kubernetes source material, but hopefully they have
405 been automatically generated since!
406
407
408
409Manuals User KUBERNETES(1)(kubernetes)