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 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|template|go-template|go-tem‐
62 plate-file|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 [
86 ⟨http://golang.org/pkg/text/template/#pkg-overview⟩].
87
88
89
91 --allow-verification-with-non-compliant-keys=false
92 Allow a SignatureVerifier to use keys which are technically
93 non-compliant with RFC6962.
94
95
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="unix:///var/run/containerd.sock"
152 containerd endpoint
153
154
155 --context=""
156 The name of the kubeconfig context to use
157
158
159 --default-not-ready-toleration-seconds=300
160 Indicates the tolerationSeconds of the toleration for
161 notReady:NoExecute that is added by default to every pod that does not
162 already have such a toleration.
163
164
165 --default-unreachable-toleration-seconds=300
166 Indicates the tolerationSeconds of the toleration for unreach‐
167 able:NoExecute that is added by default to every pod that does not
168 already have such a toleration.
169
170
171 --docker="unix:///var/run/docker.sock"
172 docker endpoint
173
174
175 --docker-env-metadata-whitelist=""
176 a comma-separated list of environment variable keys that needs to
177 be collected for docker containers
178
179
180 --docker-only=false
181 Only report docker containers in addition to root stats
182
183
184 --docker-root="/var/lib/docker"
185 DEPRECATED: docker root is read from docker info (this is a fall‐
186 back, default: /var/lib/docker)
187
188
189 --docker-tls=false
190 use TLS to connect to docker
191
192
193 --docker-tls-ca="ca.pem"
194 path to trusted CA
195
196
197 --docker-tls-cert="cert.pem"
198 path to client certificate
199
200
201 --docker-tls-key="key.pem"
202 path to private key
203
204
205 --enable-load-reader=false
206 Whether to enable cpu load reader
207
208
209 --event-storage-age-limit="default=0"
210 Max length of time for which to store events (per type). Value is a
211 comma separated list of key values, where the keys are event types
212 (e.g.: creation, oom) or "default" and the value is a duration. Default
213 is applied to all non-specified event types
214
215
216 --event-storage-event-limit="default=0"
217 Max number of events to store (per type). Value is a comma sepa‐
218 rated list of key values, where the keys are event types (e.g.: cre‐
219 ation, oom) or "default" and the value is an integer. Default is
220 applied to all non-specified event types
221
222
223 --global-housekeeping-interval=1m0s
224 Interval between global housekeepings
225
226
227 --google-json-key=""
228 The Google Cloud Platform Service Account JSON Key to use for
229 authentication.
230
231
232 --housekeeping-interval=10s
233 Interval between container housekeepings
234
235
236 --insecure-skip-tls-verify=false
237 If true, the server's certificate will not be checked for validity.
238 This will make your HTTPS connections insecure
239
240
241 --kubeconfig=""
242 Path to the kubeconfig file to use for CLI requests.
243
244
245 --log-backtrace-at=:0
246 when logging hits line file:N, emit a stack trace
247
248
249 --log-cadvisor-usage=false
250 Whether to log the usage of the cAdvisor container
251
252
253 --log-dir=""
254 If non-empty, write log files in this directory
255
256
257 --log-flush-frequency=5s
258 Maximum number of seconds between log flushes
259
260
261 --logtostderr=true
262 log to standard error instead of files
263
264
265 --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
266 Comma-separated list of files to check for machine-id. Use the
267 first one that exists.
268
269
270 --match-server-version=false
271 Require server version to match client version
272
273
274 --mesos-agent="127.0.0.1:5051"
275 Mesos agent address
276
277
278 --mesos-agent-timeout=10s
279 Mesos agent timeout
280
281
282 -n, --namespace=""
283 If present, the namespace scope for this CLI request
284
285
286 --request-timeout="0"
287 The length of time to wait before giving up on a single server
288 request. Non-zero values should contain a corresponding time unit (e.g.
289 1s, 2m, 3h). A value of zero means don't timeout requests.
290
291
292 -s, --server=""
293 The address and port of the Kubernetes API server
294
295
296 --stderrthreshold=2
297 logs at or above this threshold go to stderr
298
299
300 --storage-driver-buffer-duration=1m0s
301 Writes in the storage driver will be buffered for this duration,
302 and committed to the non memory backends as a single transaction
303
304
305 --storage-driver-db="cadvisor"
306 database name
307
308
309 --storage-driver-host="localhost:8086"
310 database host:port
311
312
313 --storage-driver-password="root"
314 database password
315
316
317 --storage-driver-secure=false
318 use secure connection with database
319
320
321 --storage-driver-table="stats"
322 table name
323
324
325 --storage-driver-user="root"
326 database username
327
328
329 --token=""
330 Bearer token for authentication to the API server
331
332
333 --user=""
334 The name of the kubeconfig user to use
335
336
337 -v, --v=0
338 log level for V logs
339
340
341 --version=false
342 Print version information and quit
343
344
345 --vmodule=
346 comma-separated list of pattern=N settings for file-filtered log‐
347 ging
348
349
350
352 # Set a deployment's nginx container image to 'nginx:1.9.1', and its busybox container image to 'busybox'.
353 kubectl set image deployment/nginx busybox=busybox nginx=nginx:1.9.1
354
355 # Update all deployments' and rc's nginx container's image to 'nginx:1.9.1'
356 kubectl set image deployments,rc nginx=nginx:1.9.1 --all
357
358 # Update image of all containers of daemonset abc to 'nginx:1.9.1'
359 kubectl set image daemonset abc *=nginx:1.9.1
360
361 # Print result (in yaml format) of updating nginx container image from local file, without hitting the server
362 kubectl set image -f path/to/file.yaml nginx=nginx:1.9.1 --local -o yaml
363
364
365
366
368 kubectl-set(1),
369
370
371
373 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
374 com) based on the kubernetes source material, but hopefully they have
375 been automatically generated since!
376
377
378
379Eric Paris kubernetes User Manuals KUBERNETES(1)