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

NAME

9       kubectl set image - Update the image of a pod template
10
11
12

SYNOPSIS

14       kubectl set image [OPTIONS]
15
16
17

DESCRIPTION

19       Update existing container image(s) of resources.
20
21
22       Possible resources include (case insensitive):
23
24
25       pod  (po),  replicationcontroller  (rc), deployment (deploy), daemonset
26       (ds), statefulset (sts), cronjob (cj), replicaset (rs)
27
28
29

OPTIONS

31       --all=false      Select all resources, in the namespace of  the  speci‐
32       fied resource types
33
34
35       --allow-missing-template-keys=true       If  true, ignore any errors in
36       templates when a field or map key is missing in the template. Only  ap‐
37       plies to golang and jsonpath output formats.
38
39
40       --dry-run="none"       Must be "none", "server", or "client". If client
41       strategy, only print the object that would be sent, without sending it.
42       If  server  strategy, submit server-side request without persisting the
43       resource.
44
45
46       --field-manager="kubectl-set"      Name of the manager  used  to  track
47       field ownership.
48
49
50       -f, --filename=[]      Filename, directory, or URL to files identifying
51       the resource to get from a server.
52
53
54       -k, --kustomize=""      Process the kustomization directory. This  flag
55       can't be used together with -f or -R.
56
57
58       --local=false       If  true, set image will NOT contact api-server but
59       run locally.
60
61
62       -o, --output=""      Output format. One of: (json, yaml, name,  go-tem‐
63       plate, go-template-file, template, templatefile, jsonpath, jsonpath-as-
64       json, jsonpath-file).
65
66
67       --record=false      Record current kubectl command in the resource  an‐
68       notation.  If  set to false, do not record the command. If set to true,
69       record the command. If not set, default to updating the existing  anno‐
70       tation value only if one already exists.
71
72
73       -R, --recursive=false      Process the directory used in -f, --filename
74       recursively. Useful when you want to manage related manifests organized
75       within the same directory.
76
77
78       -l,  --selector=""       Selector  (label query) to filter on, supports
79       '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching objects
80       must satisfy all of the specified label constraints.
81
82
83       --show-managed-fields=false       If  true, keep the managedFields when
84       printing objects in JSON or YAML format.
85
86
87       --template=""      Template string or path to template file to use when
88       -o=go-template, -o=go-template-file. The template format is golang tem‐
89       plates [http://golang.org/pkg/text/template/#pkg-overview].
90
91
92

OPTIONS INHERITED FROM PARENT COMMANDS

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

EXAMPLE

192                # Set a deployment's nginx container image to 'nginx:1.9.1', and its busybox container image to 'busybox'
193                kubectl set image deployment/nginx busybox=busybox nginx=nginx:1.9.1
194
195                # Update all deployments' and rc's nginx container's image to 'nginx:1.9.1'
196                kubectl set image deployments,rc nginx=nginx:1.9.1 --all
197
198                # Update image of all containers of daemonset abc to 'nginx:1.9.1'
199                kubectl set image daemonset abc *=nginx:1.9.1
200
201                # Print result (in yaml format) of updating nginx container image from local file, without hitting the server
202                kubectl set image -f path/to/file.yaml nginx=nginx:1.9.1 --local -o yaml
203
204
205
206

SEE ALSO

208       kubectl-set(1),
209
210
211

HISTORY

213       January 2015, Originally compiled by Eric Paris (eparis at  redhat  dot
214       com)  based  on the kubernetes source material, but hopefully they have
215       been automatically generated since!
216
217
218
219Manuals                              User            KUBERNETES(1)(kubernetes)
Impressum