1KUBERNETES(1)                      Jan 2015                      KUBERNETES(1)
2
3
4

NAME

6       kubectl set image - Update image of a pod template
7
8
9

SYNOPSIS

11       kubectl set image [OPTIONS]
12
13
14

DESCRIPTION

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

OPTIONS

28       --all=false
29           Select all resources, including uninitialized ones, in  the  names‐
30       pace 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=false
40           If  true, only print the object that would be sent, without sending
41       it.
42
43
44       -f, --filename=[]
45           Filename, directory, or URL to files identifying  the  resource  to
46       get from a server.
47
48
49       --include-uninitialized=false
50           If  true,  the kubectl command applies to uninitialized objects. If
51       explicitly set to false, this flag overrides other flags that make  the
52       kubectl commands apply to uninitialized objects, e.g., "--all". Objects
53       with empty metadata.initializers are regarded as initialized.
54
55
56       -k, --kustomize=""
57           Process the  kustomization  directory.  This  flag  can't  be  used
58       together with -f or -R.
59
60
61       --local=false
62           If true, set image will NOT contact api-server but run locally.
63
64
65       -o, --output=""
66           Output    format.    One   of:   json|yaml|name|go-template|go-tem‐
67       plate-file|template|templatefile|jsonpath|jsonpath-file.
68
69
70       --record=false
71           Record current kubectl command in the resource annotation.  If  set
72       to  false,  do  not record the command. If set to true, record the com‐
73       mand. If not set, default to updating  the  existing  annotation  value
74       only if one already exists.
75
76
77       -R, --recursive=false
78           Process  the  directory  used in -f, --filename recursively. Useful
79       when you want to manage related manifests  organized  within  the  same
80       directory.
81
82
83       -l, --selector=""
84           Selector  (label  query)  to filter on, not including uninitialized
85       ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
86
87
88       --template=""
89           Template string or path to template file  to  use  when  -o=go-tem‐
90       plate,  -o=go-template-file.  The template format is golang templates [
91http://golang.org/pkg/text/template/#pkg-overview⟩].
92
93
94

OPTIONS INHERITED FROM PARENT COMMANDS

96       --alsologtostderr=false
97           log to standard error as well as files
98
99
100       --application-metrics-count-limit=100
101           Max number of application metrics to store (per container)
102
103
104       --as=""
105           Username to impersonate for the operation
106
107
108       --as-group=[]
109           Group to impersonate for the operation, this flag can  be  repeated
110       to specify multiple groups.
111
112
113       --azure-container-registry-config=""
114           Path  to the file containing Azure container registry configuration
115       information.
116
117
118       --boot-id-file="/proc/sys/kernel/random/boot_id"
119           Comma-separated list of files to check for boot-id. Use  the  first
120       one that exists.
121
122
123       --cache-dir="/builddir/.kube/http-cache"
124           Default HTTP cache directory
125
126
127       --certificate-authority=""
128           Path to a cert file for the certificate authority
129
130
131       --client-certificate=""
132           Path to a client certificate file for TLS
133
134
135       --client-key=""
136           Path to a client key file for TLS
137
138
139       --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
140           CIDRs opened in GCE firewall for LB traffic proxy  health checks
141
142
143       --cluster=""
144           The name of the kubeconfig cluster to use
145
146
147       --container-hints="/etc/cadvisor/container_hints.json"
148           location of the container hints file
149
150
151       --containerd="/run/containerd/containerd.sock"
152           containerd endpoint
153
154
155       --containerd-namespace="k8s.io"
156           containerd namespace
157
158
159       --context=""
160           The name of the kubeconfig context to use
161
162
163       --default-not-ready-toleration-seconds=300
164           Indicates   the   tolerationSeconds   of   the    toleration    for
165       notReady:NoExecute  that is added by default to every pod that does not
166       already have such a toleration.
167
168
169       --default-unreachable-toleration-seconds=300
170           Indicates the tolerationSeconds  of  the  toleration  for  unreach‐
171       able:NoExecute  that  is  added  by  default to every pod that does not
172       already have such a toleration.
173
174
175       --docker="unix:///var/run/docker.sock"
176           docker endpoint
177
178
179       --docker-env-metadata-whitelist=""
180           a comma-separated list of environment variable keys that  needs  to
181       be collected for docker containers
182
183
184       --docker-only=false
185           Only report docker containers in addition to root stats
186
187
188       --docker-root="/var/lib/docker"
189           DEPRECATED:  docker  root is read from docker info (this is a fall‐
190       back, default: /var/lib/docker)
191
192
193       --docker-tls=false
194           use TLS to connect to docker
195
196
197       --docker-tls-ca="ca.pem"
198           path to trusted CA
199
200
201       --docker-tls-cert="cert.pem"
202           path to client certificate
203
204
205       --docker-tls-key="key.pem"
206           path to private key
207
208
209       --enable-load-reader=false
210           Whether to enable cpu load reader
211
212
213       --event-storage-age-limit="default=0"
214           Max length of time for which to store events (per type). Value is a
215       comma  separated  list  of  key  values, where the keys are event types
216       (e.g.: creation, oom) or "default" and the value is a duration. Default
217       is applied to all non-specified event types
218
219
220       --event-storage-event-limit="default=0"
221           Max  number  of  events to store (per type). Value is a comma sepa‐
222       rated list of key values, where the keys are event  types  (e.g.:  cre‐
223       ation,  oom)  or  "default"  and  the  value  is an integer. Default is
224       applied to all non-specified event types
225
226
227       --global-housekeeping-interval=1m0s
228           Interval between global housekeepings
229
230
231       --housekeeping-interval=10s
232           Interval between container housekeepings
233
234
235       --insecure-skip-tls-verify=false
236           If true, the server's certificate will not be checked for validity.
237       This will make your HTTPS connections insecure
238
239
240       --kubeconfig=""
241           Path to the kubeconfig file to use for CLI requests.
242
243
244       --log-backtrace-at=:0
245           when logging hits line file:N, emit a stack trace
246
247
248       --log-cadvisor-usage=false
249           Whether to log the usage of the cAdvisor container
250
251
252       --log-dir=""
253           If non-empty, write log files in this directory
254
255
256       --log-file=""
257           If non-empty, use this log file
258
259
260       --log-file-max-size=1800
261           Defines the maximum size a log file can grow to. Unit is megabytes.
262       If the value is 0, the maximum file size is unlimited.
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       -n, --namespace=""
283           If present, the namespace scope for this CLI request
284
285
286       --password=""
287           Password for basic authentication to the API server
288
289
290       --profile="none"
291           Name of profile to capture. One of (none|cpu|heap|goroutine|thread‐
292       create|block|mutex)
293
294
295       --profile-output="profile.pprof"
296           Name of the file to write the profile to
297
298
299       --request-timeout="0"
300           The length of time to wait before giving  up  on  a  single  server
301       request. Non-zero values should contain a corresponding time unit (e.g.
302       1s, 2m, 3h). A value of zero means don't timeout requests.
303
304
305       -s, --server=""
306           The address and port of the Kubernetes API server
307
308
309       --skip-headers=false
310           If true, avoid header prefixes in the log messages
311
312
313       --skip-log-headers=false
314           If true, avoid headers when opening log files
315
316
317       --stderrthreshold=2
318           logs at or above this threshold go to stderr
319
320
321       --storage-driver-buffer-duration=1m0s
322           Writes in the storage driver will be buffered  for  this  duration,
323       and committed to the non memory backends as a single transaction
324
325
326       --storage-driver-db="cadvisor"
327           database name
328
329
330       --storage-driver-host="localhost:8086"
331           database host:port
332
333
334       --storage-driver-password="root"
335           database password
336
337
338       --storage-driver-secure=false
339           use secure connection with database
340
341
342       --storage-driver-table="stats"
343           table name
344
345
346       --storage-driver-user="root"
347           database username
348
349
350       --token=""
351           Bearer token for authentication to the API server
352
353
354       --update-machine-info-interval=5m0s
355           Interval between machine info updates.
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           number for the log level verbosity
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

EXAMPLE

381                # Set a deployment's nginx container image to 'nginx:1.9.1', and its busybox container image to 'busybox'.
382                kubectl set image deployment/nginx busybox=busybox nginx=nginx:1.9.1
383
384                # Update all deployments' and rc's nginx container's image to 'nginx:1.9.1'
385                kubectl set image deployments,rc nginx=nginx:1.9.1 --all
386
387                # Update image of all containers of daemonset abc to 'nginx:1.9.1'
388                kubectl set image daemonset abc *=nginx:1.9.1
389
390                # Print result (in yaml format) of updating nginx container image from local file, without hitting the server
391                kubectl set image -f path/to/file.yaml nginx=nginx:1.9.1 --local -o yaml
392
393
394
395

SEE ALSO

397       kubectl-set(1),
398
399
400

HISTORY

402       January 2015, Originally compiled by Eric Paris (eparis at  redhat  dot
403       com)  based  on the kubernetes source material, but hopefully they have
404       been automatically generated since!
405
406
407
408Eric Paris                  kubernetes User Manuals              KUBERNETES(1)
Impressum