1KUBERNETES(1)(kubernetes)                            KUBERNETES(1)(kubernetes)
2
3
4
5Eric Paris Jan 2015
6
7

NAME

9       kubectl set resources - Update resource requests/limits on objects with
10       pod templates
11
12
13

SYNOPSIS

15       kubectl set resources [OPTIONS]
16
17
18

DESCRIPTION

20       Specify compute resource requirements (CPU, memory)  for  any  resource
21       that defines a pod template.  If a pod is successfully scheduled, it is
22       guaranteed the amount of resource requested, but may burst  up  to  its
23       specified limits.
24
25
26       For  each  compute  resource,  if a limit is specified and a request is
27       omitted, the request will default to the limit.
28
29
30       Possible resources include (case  insensitive):  Use  "kubectl  api-re‐
31       sources" for a complete list of supported resources..
32
33
34

OPTIONS

36       --all=false       Select  all resources, in the namespace of the speci‐
37       fied resource types
38
39
40       --allow-missing-template-keys=true      If true, ignore any  errors  in
41       templates  when a field or map key is missing in the template. Only ap‐
42       plies to golang and jsonpath output formats.
43
44
45       -c, --containers="*"      The names of containers in the  selected  pod
46       templates  to  change, all containers are selected by default - may use
47       wildcards
48
49
50       --dry-run="none"      Must be "none", "server", or "client". If  client
51       strategy, only print the object that would be sent, without sending it.
52       If server strategy, submit server-side request without  persisting  the
53       resource.
54
55
56       --field-manager="kubectl-set"       Name  of  the manager used to track
57       field ownership.
58
59
60       -f, --filename=[]      Filename, directory, or URL to files identifying
61       the resource to get from a server.
62
63
64       -k,  --kustomize=""      Process the kustomization directory. This flag
65       can't be used together with -f or -R.
66
67
68       --limits=""      The resource requirement requests for this  container.
69       For example, 'cpu=100m,memory=256Mi'.  Note that server side components
70       may assign requests depending on  the  server  configuration,  such  as
71       limit ranges.
72
73
74       --local=false       If  true, set resources will NOT contact api-server
75       but run locally.
76
77
78       -o, --output=""      Output format. One of: (json, yaml, name,  go-tem‐
79       plate, go-template-file, template, templatefile, jsonpath, jsonpath-as-
80       json, jsonpath-file).
81
82
83       --record=false      Record current kubectl command in the resource  an‐
84       notation.  If  set to false, do not record the command. If set to true,
85       record the command. If not set, default to updating the existing  anno‐
86       tation value only if one already exists.
87
88
89       -R, --recursive=false      Process the directory used in -f, --filename
90       recursively. Useful when you want to manage related manifests organized
91       within the same directory.
92
93
94       --requests=""       The  resource  requirement  requests  for this con‐
95       tainer.  For example, 'cpu=100m,memory=256Mi'.  Note that  server  side
96       components  may  assign requests depending on the server configuration,
97       such as limit ranges.
98
99
100       -l, --selector=""      Selector (label query) to  filter  on,  supports
101       '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching objects
102       must satisfy all of the specified label constraints.
103
104
105       --show-managed-fields=false      If true, keep the  managedFields  when
106       printing objects in JSON or YAML format.
107
108
109       --template=""      Template string or path to template file to use when
110       -o=go-template, -o=go-template-file. The template format is golang tem‐
111       plates [http://golang.org/pkg/text/template/#pkg-overview].
112
113
114

OPTIONS INHERITED FROM PARENT COMMANDS

116       --as=""      Username to impersonate for the operation. User could be a
117       regular user or a service account in a namespace.
118
119
120       --as-group=[]      Group to impersonate for the  operation,  this  flag
121       can be repeated to specify multiple groups.
122
123
124       --as-uid=""      UID to impersonate for the operation.
125
126
127       --azure-container-registry-config=""       Path  to the file containing
128       Azure container registry configuration information.
129
130
131       --cache-dir="/builddir/.kube/cache"      Default cache directory
132
133
134       --certificate-authority=""      Path to a cert file for the certificate
135       authority
136
137
138       --client-certificate=""      Path to a client certificate file for TLS
139
140
141       --client-key=""      Path to a client key file for TLS
142
143
144       --cluster=""      The name of the kubeconfig cluster to use
145
146
147       --context=""      The name of the kubeconfig context to use
148
149
150       --insecure-skip-tls-verify=false      If true, the server's certificate
151       will not be checked for validity. This will make your HTTPS connections
152       insecure
153
154
155       --kubeconfig=""       Path  to  the  kubeconfig file to use for CLI re‐
156       quests.
157
158
159       --match-server-version=false       Require  server  version  to   match
160       client version
161
162
163       -n,  --namespace=""       If  present, the namespace scope for this CLI
164       request
165
166
167       --password=""      Password for basic authentication to the API server
168
169
170       --profile="none"        Name   of   profile   to   capture.   One    of
171       (none|cpu|heap|goroutine|threadcreate|block|mutex)
172
173
174       --profile-output="profile.pprof"       Name  of  the  file to write the
175       profile to
176
177
178       --request-timeout="0"      The length of time to wait before giving  up
179       on  a  single  server  request. Non-zero values should contain a corre‐
180       sponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't time‐
181       out requests.
182
183
184       -s, --server=""      The address and port of the Kubernetes API server
185
186
187       --tls-server-name=""       Server  name  to  use for server certificate
188       validation. If it is not provided, the hostname  used  to  contact  the
189       server is used
190
191
192       --token=""      Bearer token for authentication to the API server
193
194
195       --user=""      The name of the kubeconfig user to use
196
197
198       --username=""      Username for basic authentication to the API server
199
200
201       --version=false      Print version information and quit
202
203
204       --warnings-as-errors=false      Treat warnings received from the server
205       as errors and exit with a non-zero exit code
206
207
208

EXAMPLE

210                # Set a deployments nginx container cpu limits to "200m" and memory to "512Mi"
211                kubectl set resources deployment nginx -c=nginx --limits=cpu=200m,memory=512Mi
212
213                # Set the resource request and limits for all containers in nginx
214                kubectl set resources deployment nginx --limits=cpu=200m,memory=512Mi --requests=cpu=100m,memory=256Mi
215
216                # Remove the resource requests for resources on containers in nginx
217                kubectl set resources deployment nginx --limits=cpu=0,memory=0 --requests=cpu=0,memory=0
218
219                # Print the result (in yaml format) of updating nginx container limits from a local, without hitting the server
220                kubectl set resources -f path/to/file.yaml --limits=cpu=200m,memory=512Mi --local -o yaml
221
222
223
224

SEE ALSO

226       kubectl-set(1),
227
228
229

HISTORY

231       January 2015, Originally compiled by Eric Paris (eparis at  redhat  dot
232       com)  based  on the kubernetes source material, but hopefully they have
233       been automatically generated since!
234
235
236
237Manuals                              User            KUBERNETES(1)(kubernetes)
Impressum