1KUBERNETES(1) Jan 2015 KUBERNETES(1)
2
3
4
6 kubectl autoscale - Auto-scale a Deployment, ReplicaSet, or Replica‐
7 tionController
8
9
10
12 kubectl autoscale [OPTIONS]
13
14
15
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
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 --max=-1
57 The upper limit for the number of pods that can be set by the
58 autoscaler. Required.
59
60
61 --min=-1
62 The lower limit for the number of pods that can be set by the
63 autoscaler. If it's not specified or negative, the server will apply a
64 default value.
65
66
67 --name=""
68 The name for the newly created object. If not specified, the name
69 of the input resource will be used.
70
71
72 -o, --output=""
73 Output format. One of: json|yaml|name|go-template|go-tem‐
74 plate-file|template|templatefile|jsonpath|jsonpath-file.
75
76
77 --record=false
78 Record current kubectl command in the resource annotation. If set
79 to false, do not record the command. If set to true, record the com‐
80 mand. If not set, default to updating the existing annotation value
81 only if one already exists.
82
83
84 -R, --recursive=false
85 Process the directory used in -f, --filename recursively. Useful
86 when you want to manage related manifests organized within the same
87 directory.
88
89
90 --save-config=false
91 If true, the configuration of current object will be saved in its
92 annotation. Otherwise, the annotation will be unchanged. This flag is
93 useful when you want to perform kubectl apply on this object in the
94 future.
95
96
97 --template=""
98 Template string or path to template file to use when -o=go-tem‐
99 plate, -o=go-template-file. The template format is golang templates [
100 ⟨http://golang.org/pkg/text/template/#pkg-overview⟩].
101
102
103
105 --alsologtostderr=false
106 log to standard error as well as files
107
108
109 --application-metrics-count-limit=100
110 Max number of application metrics to store (per container)
111
112
113 --as=""
114 Username to impersonate for the operation
115
116
117 --as-group=[]
118 Group to impersonate for the operation, this flag can be repeated
119 to specify multiple groups.
120
121
122 --azure-container-registry-config=""
123 Path to the file containing Azure container registry configuration
124 information.
125
126
127 --boot-id-file="/proc/sys/kernel/random/boot_id"
128 Comma-separated list of files to check for boot-id. Use the first
129 one that exists.
130
131
132 --cache-dir="/builddir/.kube/http-cache"
133 Default HTTP cache directory
134
135
136 --certificate-authority=""
137 Path to a cert file for the certificate authority
138
139
140 --client-certificate=""
141 Path to a client certificate file for TLS
142
143
144 --client-key=""
145 Path to a client key file for TLS
146
147
148 --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
149 CIDRs opened in GCE firewall for LB traffic proxy health checks
150
151
152 --cluster=""
153 The name of the kubeconfig cluster to use
154
155
156 --container-hints="/etc/cadvisor/container_hints.json"
157 location of the container hints file
158
159
160 --containerd="unix:///var/run/containerd.sock"
161 containerd endpoint
162
163
164 --context=""
165 The name of the kubeconfig context to use
166
167
168 --default-not-ready-toleration-seconds=300
169 Indicates the tolerationSeconds of the toleration for
170 notReady:NoExecute that is added by default to every pod that does not
171 already have such a toleration.
172
173
174 --default-unreachable-toleration-seconds=300
175 Indicates the tolerationSeconds of the toleration for unreach‐
176 able:NoExecute that is added by default to every pod that does not
177 already have such a toleration.
178
179
180 --docker="unix:///var/run/docker.sock"
181 docker endpoint
182
183
184 --docker-env-metadata-whitelist=""
185 a comma-separated list of environment variable keys that needs to
186 be collected for docker containers
187
188
189 --docker-only=false
190 Only report docker containers in addition to root stats
191
192
193 --docker-root="/var/lib/docker"
194 DEPRECATED: docker root is read from docker info (this is a fall‐
195 back, default: /var/lib/docker)
196
197
198 --docker-tls=false
199 use TLS to connect to docker
200
201
202 --docker-tls-ca="ca.pem"
203 path to trusted CA
204
205
206 --docker-tls-cert="cert.pem"
207 path to client certificate
208
209
210 --docker-tls-key="key.pem"
211 path to private key
212
213
214 --enable-load-reader=false
215 Whether to enable cpu load reader
216
217
218 --event-storage-age-limit="default=0"
219 Max length of time for which to store events (per type). Value is a
220 comma separated list of key values, where the keys are event types
221 (e.g.: creation, oom) or "default" and the value is a duration. Default
222 is applied to all non-specified event types
223
224
225 --event-storage-event-limit="default=0"
226 Max number of events to store (per type). Value is a comma sepa‐
227 rated list of key values, where the keys are event types (e.g.: cre‐
228 ation, oom) or "default" and the value is an integer. Default is
229 applied to all non-specified event types
230
231
232 --global-housekeeping-interval=1m0s
233 Interval between global housekeepings
234
235
236 --housekeeping-interval=10s
237 Interval between container housekeepings
238
239
240 --insecure-skip-tls-verify=false
241 If true, the server's certificate will not be checked for validity.
242 This will make your HTTPS connections insecure
243
244
245 --kubeconfig=""
246 Path to the kubeconfig file to use for CLI requests.
247
248
249 --log-backtrace-at=:0
250 when logging hits line file:N, emit a stack trace
251
252
253 --log-cadvisor-usage=false
254 Whether to log the usage of the cAdvisor container
255
256
257 --log-dir=""
258 If non-empty, write log files in this directory
259
260
261 --log-file=""
262 If non-empty, use this log file
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 --password=""
295 Password for basic authentication to the API server
296
297
298 --profile="none"
299 Name of profile to capture. One of (none|cpu|heap|goroutine|thread‐
300 create|block|mutex)
301
302
303 --profile-output="profile.pprof"
304 Name of the file to write the profile to
305
306
307 --request-timeout="0"
308 The length of time to wait before giving up on a single server
309 request. Non-zero values should contain a corresponding time unit (e.g.
310 1s, 2m, 3h). A value of zero means don't timeout requests.
311
312
313 -s, --server=""
314 The address and port of the Kubernetes API server
315
316
317 --skip-headers=false
318 If true, avoid header prefixes in the log messages
319
320
321 --stderrthreshold=2
322 logs at or above this threshold go to stderr
323
324
325 --storage-driver-buffer-duration=1m0s
326 Writes in the storage driver will be buffered for this duration,
327 and committed to the non memory backends as a single transaction
328
329
330 --storage-driver-db="cadvisor"
331 database name
332
333
334 --storage-driver-host="localhost:8086"
335 database host:port
336
337
338 --storage-driver-password="root"
339 database password
340
341
342 --storage-driver-secure=false
343 use secure connection with database
344
345
346 --storage-driver-table="stats"
347 table name
348
349
350 --storage-driver-user="root"
351 database username
352
353
354 --token=""
355 Bearer token for authentication to the API server
356
357
358 --user=""
359 The name of the kubeconfig user to use
360
361
362 --username=""
363 Username for basic authentication to the API server
364
365
366 -v, --v=0
367 log level for V logs
368
369
370 --version=false
371 Print version information and quit
372
373
374 --vmodule=
375 comma-separated list of pattern=N settings for file-filtered log‐
376 ging
377
378
379
381 # 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:
382 kubectl autoscale deployment foo --min=2 --max=10
383
384 # Auto scale a replication controller "foo", with the number of pods between 1 and 5, target CPU utilization at 80%:
385 kubectl autoscale rc foo --max=5 --cpu-percent=80
386
387
388
389
391 kubectl(1),
392
393
394
396 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
397 com) based on the kubernetes source material, but hopefully they have
398 been automatically generated since!
399
400
401
402Eric Paris kubernetes User Manuals KUBERNETES(1)