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       --local=false
57           If true, set image will NOT contact api-server but run locally.
58
59
60       -o, --output=""
61           Output   format.   One    of:    json|yaml|name|go-template|go-tem‐
62       plate-file|template|templatefile|jsonpath|jsonpath-file.
63
64
65       --record=false
66           Record  current  kubectl command in the resource annotation. If set
67       to false, do not record the command. If set to true,  record  the  com‐
68       mand.  If  not  set,  default to updating the existing annotation value
69       only if one already exists.
70
71
72       -R, --recursive=false
73           Process the directory used in -f,  --filename  recursively.  Useful
74       when  you  want  to  manage related manifests organized within the same
75       directory.
76
77
78       -l, --selector=""
79           Selector (label query) to filter on,  not  including  uninitialized
80       ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
81
82
83       --template=""
84           Template  string  or  path  to template file to use when -o=go-tem‐
85       plate, -o=go-template-file. The template format is golang  templates  [
86http://golang.org/pkg/text/template/#pkg-overview⟩].
87
88
89

OPTIONS INHERITED FROM PARENT COMMANDS

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

EXAMPLE

367                # Set a deployment's nginx container image to 'nginx:1.9.1', and its busybox container image to 'busybox'.
368                kubectl set image deployment/nginx busybox=busybox nginx=nginx:1.9.1
369
370                # Update all deployments' and rc's nginx container's image to 'nginx:1.9.1'
371                kubectl set image deployments,rc nginx=nginx:1.9.1 --all
372
373                # Update image of all containers of daemonset abc to 'nginx:1.9.1'
374                kubectl set image daemonset abc *=nginx:1.9.1
375
376                # Print result (in yaml format) of updating nginx container image from local file, without hitting the server
377                kubectl set image -f path/to/file.yaml nginx=nginx:1.9.1 --local -o yaml
378
379
380
381

SEE ALSO

383       kubectl-set(1),
384
385
386

HISTORY

388       January 2015, Originally compiled by Eric Paris (eparis at  redhat  dot
389       com)  based  on the kubernetes source material, but hopefully they have
390       been automatically generated since!
391
392
393
394Eric Paris                  kubernetes User Manuals              KUBERNETES(1)
Impressum