1KUBERNETES(1) Jan 2015 KUBERNETES(1)
2
3
4
6 kubectl edit - Edit a resource on the server
7
8
9
11 kubectl edit [OPTIONS]
12
13
14
16 Edit a resource from the default editor.
17
18
19 The edit command allows you to directly edit any API resource you can
20 retrieve via the command line tools. It will open the editor defined by
21 your KUBE _EDITOR, or EDITOR environment variables, or fall back to
22 'vi' for Linux or 'notepad' for Windows. You can edit multiple objects,
23 although changes are applied one at a time. The command accepts file‐
24 names as well as command line arguments, although the files you point
25 to must be previously saved versions of resources.
26
27
28 Editing is done with the API version used to fetch the resource. To
29 edit using a specific API version, fully-qualify the resource, version,
30 and group.
31
32
33 The default format is YAML. To edit in JSON, specify "-o json".
34
35
36 The flag --windows-line-endings can be used to force Windows line end‐
37 ings, otherwise the default for your operating system will be used.
38
39
40 In the event an error occurs while updating, a temporary file will be
41 created on disk that contains your unapplied changes. The most common
42 error when updating a resource is another editor changing the resource
43 on the server. When this occurs, you will have to apply your changes to
44 the newer version of the resource, or update your temporary saved copy
45 to include the latest resource version.
46
47
48
50 --allow-missing-template-keys=true
51 If true, ignore any errors in templates when a field or map key is
52 missing in the template. Only applies to golang and jsonpath output
53 formats.
54
55
56 -f, --filename=[]
57 Filename, directory, or URL to files to use to edit the resource
58
59
60 --include-uninitialized=false
61 If true, the kubectl command applies to uninitialized objects. If
62 explicitly set to false, this flag overrides other flags that make the
63 kubectl commands apply to uninitialized objects, e.g., "--all". Objects
64 with empty metadata.initializers are regarded as initialized.
65
66
67 -o, --output=""
68 Output format. One of: json|yaml|name|go-template|go-tem‐
69 plate-file|template|templatefile|jsonpath|jsonpath-file.
70
71
72 --output-patch=false
73 Output the patch if the resource is edited.
74
75
76 --record=false
77 Record current kubectl command in the resource annotation. If set
78 to false, do not record the command. If set to true, record the com‐
79 mand. If not set, default to updating the existing annotation value
80 only if one already exists.
81
82
83 -R, --recursive=false
84 Process the directory used in -f, --filename recursively. Useful
85 when you want to manage related manifests organized within the same
86 directory.
87
88
89 --save-config=false
90 If true, the configuration of current object will be saved in its
91 annotation. Otherwise, the annotation will be unchanged. This flag is
92 useful when you want to perform kubectl apply on this object in the
93 future.
94
95
96 --template=""
97 Template string or path to template file to use when -o=go-tem‐
98 plate, -o=go-template-file. The template format is golang templates [
99 ⟨http://golang.org/pkg/text/template/#pkg-overview⟩].
100
101
102 --validate=true
103 If true, use a schema to validate the input before sending it
104
105
106 --windows-line-endings=false
107 Defaults to the line ending native to your platform.
108
109
110
112 --alsologtostderr=false
113 log to standard error as well as files
114
115
116 --application-metrics-count-limit=100
117 Max number of application metrics to store (per container)
118
119
120 --as=""
121 Username to impersonate for the operation
122
123
124 --as-group=[]
125 Group to impersonate for the operation, this flag can be repeated
126 to specify multiple groups.
127
128
129 --azure-container-registry-config=""
130 Path to the file containing Azure container registry configuration
131 information.
132
133
134 --boot-id-file="/proc/sys/kernel/random/boot_id"
135 Comma-separated list of files to check for boot-id. Use the first
136 one that exists.
137
138
139 --cache-dir="/builddir/.kube/http-cache"
140 Default HTTP cache directory
141
142
143 --certificate-authority=""
144 Path to a cert file for the certificate authority
145
146
147 --client-certificate=""
148 Path to a client certificate file for TLS
149
150
151 --client-key=""
152 Path to a client key file for TLS
153
154
155 --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
156 CIDRs opened in GCE firewall for LB traffic proxy health checks
157
158
159 --cluster=""
160 The name of the kubeconfig cluster to use
161
162
163 --container-hints="/etc/cadvisor/container_hints.json"
164 location of the container hints file
165
166
167 --containerd="unix:///var/run/containerd.sock"
168 containerd endpoint
169
170
171 --context=""
172 The name of the kubeconfig context to use
173
174
175 --default-not-ready-toleration-seconds=300
176 Indicates the tolerationSeconds of the toleration for
177 notReady:NoExecute that is added by default to every pod that does not
178 already have such a toleration.
179
180
181 --default-unreachable-toleration-seconds=300
182 Indicates the tolerationSeconds of the toleration for unreach‐
183 able:NoExecute that is added by default to every pod that does not
184 already have such a toleration.
185
186
187 --docker="unix:///var/run/docker.sock"
188 docker endpoint
189
190
191 --docker-env-metadata-whitelist=""
192 a comma-separated list of environment variable keys that needs to
193 be collected for docker containers
194
195
196 --docker-only=false
197 Only report docker containers in addition to root stats
198
199
200 --docker-root="/var/lib/docker"
201 DEPRECATED: docker root is read from docker info (this is a fall‐
202 back, default: /var/lib/docker)
203
204
205 --docker-tls=false
206 use TLS to connect to docker
207
208
209 --docker-tls-ca="ca.pem"
210 path to trusted CA
211
212
213 --docker-tls-cert="cert.pem"
214 path to client certificate
215
216
217 --docker-tls-key="key.pem"
218 path to private key
219
220
221 --enable-load-reader=false
222 Whether to enable cpu load reader
223
224
225 --event-storage-age-limit="default=0"
226 Max length of time for which to store events (per type). Value is a
227 comma separated list of key values, where the keys are event types
228 (e.g.: creation, oom) or "default" and the value is a duration. Default
229 is applied to all non-specified event types
230
231
232 --event-storage-event-limit="default=0"
233 Max number of events to store (per type). Value is a comma sepa‐
234 rated list of key values, where the keys are event types (e.g.: cre‐
235 ation, oom) or "default" and the value is an integer. Default is
236 applied to all non-specified event types
237
238
239 --global-housekeeping-interval=1m0s
240 Interval between global housekeepings
241
242
243 --housekeeping-interval=10s
244 Interval between container housekeepings
245
246
247 --insecure-skip-tls-verify=false
248 If true, the server's certificate will not be checked for validity.
249 This will make your HTTPS connections insecure
250
251
252 --kubeconfig=""
253 Path to the kubeconfig file to use for CLI requests.
254
255
256 --log-backtrace-at=:0
257 when logging hits line file:N, emit a stack trace
258
259
260 --log-cadvisor-usage=false
261 Whether to log the usage of the cAdvisor container
262
263
264 --log-dir=""
265 If non-empty, write log files in this directory
266
267
268 --log-file=""
269 If non-empty, use this log file
270
271
272 --log-flush-frequency=5s
273 Maximum number of seconds between log flushes
274
275
276 --logtostderr=true
277 log to standard error instead of files
278
279
280 --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
281 Comma-separated list of files to check for machine-id. Use the
282 first one that exists.
283
284
285 --match-server-version=false
286 Require server version to match client version
287
288
289 --mesos-agent="127.0.0.1:5051"
290 Mesos agent address
291
292
293 --mesos-agent-timeout=10s
294 Mesos agent timeout
295
296
297 -n, --namespace=""
298 If present, the namespace scope for this CLI request
299
300
301 --password=""
302 Password for basic authentication to the API server
303
304
305 --profile="none"
306 Name of profile to capture. One of (none|cpu|heap|goroutine|thread‐
307 create|block|mutex)
308
309
310 --profile-output="profile.pprof"
311 Name of the file to write the profile to
312
313
314 --request-timeout="0"
315 The length of time to wait before giving up on a single server
316 request. Non-zero values should contain a corresponding time unit (e.g.
317 1s, 2m, 3h). A value of zero means don't timeout requests.
318
319
320 -s, --server=""
321 The address and port of the Kubernetes API server
322
323
324 --skip-headers=false
325 If true, avoid header prefixes in the log messages
326
327
328 --stderrthreshold=2
329 logs at or above this threshold go to stderr
330
331
332 --storage-driver-buffer-duration=1m0s
333 Writes in the storage driver will be buffered for this duration,
334 and committed to the non memory backends as a single transaction
335
336
337 --storage-driver-db="cadvisor"
338 database name
339
340
341 --storage-driver-host="localhost:8086"
342 database host:port
343
344
345 --storage-driver-password="root"
346 database password
347
348
349 --storage-driver-secure=false
350 use secure connection with database
351
352
353 --storage-driver-table="stats"
354 table name
355
356
357 --storage-driver-user="root"
358 database username
359
360
361 --token=""
362 Bearer token for authentication to the API server
363
364
365 --user=""
366 The name of the kubeconfig user to use
367
368
369 --username=""
370 Username for basic authentication to the API server
371
372
373 -v, --v=0
374 log level for V logs
375
376
377 --version=false
378 Print version information and quit
379
380
381 --vmodule=
382 comma-separated list of pattern=N settings for file-filtered log‐
383 ging
384
385
386
388 # Edit the service named 'docker-registry':
389 kubectl edit svc/docker-registry
390
391 # Use an alternative editor
392 KUBE_EDITOR="nano" kubectl edit svc/docker-registry
393
394 # Edit the job 'myjob' in JSON using the v1 API format:
395 kubectl edit job.v1.batch/myjob -o json
396
397 # Edit the deployment 'mydeployment' in YAML and save the modified config in its annotation:
398 kubectl edit deployment/mydeployment -o yaml --save-config
399
400
401
402
404 kubectl(1),
405
406
407
409 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
410 com) based on the kubernetes source material, but hopefully they have
411 been automatically generated since!
412
413
414
415Eric Paris kubernetes User Manuals KUBERNETES(1)