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