1KUBERNETES(1) Jan 2015 KUBERNETES(1)
2
3
4
6 kubectl set resources - Update resource requests/limits on objects with
7 pod templates
8
9
10
12 kubectl set resources [OPTIONS]
13
14
15
17 Specify compute resource requirements (cpu, memory) for any resource
18 that defines a pod template. If a pod is successfully scheduled, it is
19 guaranteed the amount of resource requested, but may burst up to its
20 specified limits.
21
22
23 for each compute resource, if a limit is specified and a request is
24 omitted, the request will default to the limit.
25
26
27 Possible resources include (case insensitive): Use "kubectl
28 api-resources" for a complete list of supported resources..
29
30
31
33 --all=false
34 Select all resources, including uninitialized ones, in the names‐
35 pace of the specified resource types
36
37
38 --allow-missing-template-keys=true
39 If true, ignore any errors in templates when a field or map key is
40 missing in the template. Only applies to golang and jsonpath output
41 formats.
42
43
44 -c, --containers="*"
45 The names of containers in the selected pod templates to change,
46 all containers are selected by default - may use wildcards
47
48
49 --dry-run=false
50 If true, only print the object that would be sent, without sending
51 it.
52
53
54 -f, --filename=[]
55 Filename, directory, or URL to files identifying the resource to
56 get from a server.
57
58
59 --include-uninitialized=false
60 If true, the kubectl command applies to uninitialized objects. If
61 explicitly set to false, this flag overrides other flags that make the
62 kubectl commands apply to uninitialized objects, e.g., "--all". Objects
63 with empty metadata.initializers are regarded as initialized.
64
65
66 --limits=""
67 The resource requirement requests for this container. For example,
68 'cpu=100m,memory=256Mi'. Note that server side components may assign
69 requests depending on the server configuration, such as limit ranges.
70
71
72 --local=false
73 If true, set resources will NOT contact api-server but run locally.
74
75
76 -o, --output=""
77 Output format. One of: json|yaml|name|go-template|go-tem‐
78 plate-file|template|templatefile|jsonpath|jsonpath-file.
79
80
81 --record=false
82 Record current kubectl command in the resource annotation. If set
83 to false, do not record the command. If set to true, record the com‐
84 mand. If not set, default to updating the existing annotation value
85 only if one already exists.
86
87
88 -R, --recursive=false
89 Process the directory used in -f, --filename recursively. Useful
90 when you want to manage related manifests organized within the same
91 directory.
92
93
94 --requests=""
95 The resource requirement requests for this container. For example,
96 'cpu=100m,memory=256Mi'. Note that server side components may assign
97 requests depending on the server configuration, such as limit ranges.
98
99
100 -l, --selector=""
101 Selector (label query) to filter on, not including uninitialized
102 ones,supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
103
104
105 --template=""
106 Template string or path to template file to use when -o=go-tem‐
107 plate, -o=go-template-file. The template format is golang templates [
108 ⟨http://golang.org/pkg/text/template/#pkg-overview⟩].
109
110
111
113 --alsologtostderr=false
114 log to standard error as well as files
115
116
117 --application-metrics-count-limit=100
118 Max number of application metrics to store (per container)
119
120
121 --as=""
122 Username to impersonate for the operation
123
124
125 --as-group=[]
126 Group to impersonate for the operation, this flag can be repeated
127 to specify multiple groups.
128
129
130 --azure-container-registry-config=""
131 Path to the file containing Azure container registry configuration
132 information.
133
134
135 --boot-id-file="/proc/sys/kernel/random/boot_id"
136 Comma-separated list of files to check for boot-id. Use the first
137 one that exists.
138
139
140 --cache-dir="/builddir/.kube/http-cache"
141 Default HTTP cache directory
142
143
144 --certificate-authority=""
145 Path to a cert file for the certificate authority
146
147
148 --client-certificate=""
149 Path to a client certificate file for TLS
150
151
152 --client-key=""
153 Path to a client key file for TLS
154
155
156 --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
157 CIDRs opened in GCE firewall for LB traffic proxy health checks
158
159
160 --cluster=""
161 The name of the kubeconfig cluster to use
162
163
164 --container-hints="/etc/cadvisor/container_hints.json"
165 location of the container hints file
166
167
168 --containerd="unix:///var/run/containerd.sock"
169 containerd endpoint
170
171
172 --context=""
173 The name of the kubeconfig context to use
174
175
176 --default-not-ready-toleration-seconds=300
177 Indicates the tolerationSeconds of the toleration for
178 notReady:NoExecute that is added by default to every pod that does not
179 already have such a toleration.
180
181
182 --default-unreachable-toleration-seconds=300
183 Indicates the tolerationSeconds of the toleration for unreach‐
184 able:NoExecute that is added by default to every pod that does not
185 already have such a toleration.
186
187
188 --docker="unix:///var/run/docker.sock"
189 docker endpoint
190
191
192 --docker-env-metadata-whitelist=""
193 a comma-separated list of environment variable keys that needs to
194 be collected for docker containers
195
196
197 --docker-only=false
198 Only report docker containers in addition to root stats
199
200
201 --docker-root="/var/lib/docker"
202 DEPRECATED: docker root is read from docker info (this is a fall‐
203 back, default: /var/lib/docker)
204
205
206 --docker-tls=false
207 use TLS to connect to docker
208
209
210 --docker-tls-ca="ca.pem"
211 path to trusted CA
212
213
214 --docker-tls-cert="cert.pem"
215 path to client certificate
216
217
218 --docker-tls-key="key.pem"
219 path to private key
220
221
222 --enable-load-reader=false
223 Whether to enable cpu load reader
224
225
226 --event-storage-age-limit="default=0"
227 Max length of time for which to store events (per type). Value is a
228 comma separated list of key values, where the keys are event types
229 (e.g.: creation, oom) or "default" and the value is a duration. Default
230 is applied to all non-specified event types
231
232
233 --event-storage-event-limit="default=0"
234 Max number of events to store (per type). Value is a comma sepa‐
235 rated list of key values, where the keys are event types (e.g.: cre‐
236 ation, oom) or "default" and the value is an integer. Default is
237 applied to all non-specified event types
238
239
240 --global-housekeeping-interval=1m0s
241 Interval between global housekeepings
242
243
244 --housekeeping-interval=10s
245 Interval between container housekeepings
246
247
248 --insecure-skip-tls-verify=false
249 If true, the server's certificate will not be checked for validity.
250 This will make your HTTPS connections insecure
251
252
253 --kubeconfig=""
254 Path to the kubeconfig file to use for CLI requests.
255
256
257 --log-backtrace-at=:0
258 when logging hits line file:N, emit a stack trace
259
260
261 --log-cadvisor-usage=false
262 Whether to log the usage of the cAdvisor container
263
264
265 --log-dir=""
266 If non-empty, write log files in this directory
267
268
269 --log-file=""
270 If non-empty, use this log file
271
272
273 --log-flush-frequency=5s
274 Maximum number of seconds between log flushes
275
276
277 --logtostderr=true
278 log to standard error instead of files
279
280
281 --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
282 Comma-separated list of files to check for machine-id. Use the
283 first one that exists.
284
285
286 --match-server-version=false
287 Require server version to match client version
288
289
290 --mesos-agent="127.0.0.1:5051"
291 Mesos agent address
292
293
294 --mesos-agent-timeout=10s
295 Mesos agent timeout
296
297
298 -n, --namespace=""
299 If present, the namespace scope for this CLI request
300
301
302 --password=""
303 Password for basic authentication to the API server
304
305
306 --profile="none"
307 Name of profile to capture. One of (none|cpu|heap|goroutine|thread‐
308 create|block|mutex)
309
310
311 --profile-output="profile.pprof"
312 Name of the file to write the profile to
313
314
315 --request-timeout="0"
316 The length of time to wait before giving up on a single server
317 request. Non-zero values should contain a corresponding time unit (e.g.
318 1s, 2m, 3h). A value of zero means don't timeout requests.
319
320
321 -s, --server=""
322 The address and port of the Kubernetes API server
323
324
325 --skip-headers=false
326 If true, avoid header prefixes in the log messages
327
328
329 --stderrthreshold=2
330 logs at or above this threshold go to stderr
331
332
333 --storage-driver-buffer-duration=1m0s
334 Writes in the storage driver will be buffered for this duration,
335 and committed to the non memory backends as a single transaction
336
337
338 --storage-driver-db="cadvisor"
339 database name
340
341
342 --storage-driver-host="localhost:8086"
343 database host:port
344
345
346 --storage-driver-password="root"
347 database password
348
349
350 --storage-driver-secure=false
351 use secure connection with database
352
353
354 --storage-driver-table="stats"
355 table name
356
357
358 --storage-driver-user="root"
359 database username
360
361
362 --token=""
363 Bearer token for authentication to the API server
364
365
366 --user=""
367 The name of the kubeconfig user to use
368
369
370 --username=""
371 Username for basic authentication to the API server
372
373
374 -v, --v=0
375 log level for V logs
376
377
378 --version=false
379 Print version information and quit
380
381
382 --vmodule=
383 comma-separated list of pattern=N settings for file-filtered log‐
384 ging
385
386
387
389 # Set a deployments nginx container cpu limits to "200m" and memory to "512Mi"
390 kubectl set resources deployment nginx -c=nginx --limits=cpu=200m,memory=512Mi
391
392 # Set the resource request and limits for all containers in nginx
393 kubectl set resources deployment nginx --limits=cpu=200m,memory=512Mi --requests=cpu=100m,memory=256Mi
394
395 # Remove the resource requests for resources on containers in nginx
396 kubectl set resources deployment nginx --limits=cpu=0,memory=0 --requests=cpu=0,memory=0
397
398 # Print the result (in yaml format) of updating nginx container limits from a local, without hitting the server
399 kubectl set resources -f path/to/file.yaml --limits=cpu=200m,memory=512Mi --local -o yaml
400
401
402
403
405 kubectl-set(1),
406
407
408
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)