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|template|go-template|go-tem‐
69 plate-file|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 --allow-verification-with-non-compliant-keys=false
113 Allow a SignatureVerifier to use keys which are technically
114 non-compliant with RFC6962.
115
116
117 --alsologtostderr=false
118 log to standard error as well as files
119
120
121 --application-metrics-count-limit=100
122 Max number of application metrics to store (per container)
123
124
125 --as=""
126 Username to impersonate for the operation
127
128
129 --as-group=[]
130 Group to impersonate for the operation, this flag can be repeated
131 to specify multiple groups.
132
133
134 --azure-container-registry-config=""
135 Path to the file containing Azure container registry configuration
136 information.
137
138
139 --boot-id-file="/proc/sys/kernel/random/boot_id"
140 Comma-separated list of files to check for boot-id. Use the first
141 one that exists.
142
143
144 --cache-dir="/builddir/.kube/http-cache"
145 Default HTTP cache directory
146
147
148 --certificate-authority=""
149 Path to a cert file for the certificate authority
150
151
152 --client-certificate=""
153 Path to a client certificate file for TLS
154
155
156 --client-key=""
157 Path to a client key file for TLS
158
159
160 --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
161 CIDRs opened in GCE firewall for LB traffic proxy health checks
162
163
164 --cluster=""
165 The name of the kubeconfig cluster to use
166
167
168 --container-hints="/etc/cadvisor/container_hints.json"
169 location of the container hints file
170
171
172 --containerd="unix:///var/run/containerd.sock"
173 containerd endpoint
174
175
176 --context=""
177 The name of the kubeconfig context to use
178
179
180 --default-not-ready-toleration-seconds=300
181 Indicates the tolerationSeconds of the toleration for
182 notReady:NoExecute that is added by default to every pod that does not
183 already have such a toleration.
184
185
186 --default-unreachable-toleration-seconds=300
187 Indicates the tolerationSeconds of the toleration for unreach‐
188 able:NoExecute that is added by default to every pod that does not
189 already have such a toleration.
190
191
192 --docker="unix:///var/run/docker.sock"
193 docker endpoint
194
195
196 --docker-env-metadata-whitelist=""
197 a comma-separated list of environment variable keys that needs to
198 be collected for docker containers
199
200
201 --docker-only=false
202 Only report docker containers in addition to root stats
203
204
205 --docker-root="/var/lib/docker"
206 DEPRECATED: docker root is read from docker info (this is a fall‐
207 back, default: /var/lib/docker)
208
209
210 --docker-tls=false
211 use TLS to connect to docker
212
213
214 --docker-tls-ca="ca.pem"
215 path to trusted CA
216
217
218 --docker-tls-cert="cert.pem"
219 path to client certificate
220
221
222 --docker-tls-key="key.pem"
223 path to private key
224
225
226 --enable-load-reader=false
227 Whether to enable cpu load reader
228
229
230 --event-storage-age-limit="default=0"
231 Max length of time for which to store events (per type). Value is a
232 comma separated list of key values, where the keys are event types
233 (e.g.: creation, oom) or "default" and the value is a duration. Default
234 is applied to all non-specified event types
235
236
237 --event-storage-event-limit="default=0"
238 Max number of events to store (per type). Value is a comma sepa‐
239 rated list of key values, where the keys are event types (e.g.: cre‐
240 ation, oom) or "default" and the value is an integer. Default is
241 applied to all non-specified event types
242
243
244 --global-housekeeping-interval=1m0s
245 Interval between global housekeepings
246
247
248 --google-json-key=""
249 The Google Cloud Platform Service Account JSON Key to use for
250 authentication.
251
252
253 --housekeeping-interval=10s
254 Interval between container housekeepings
255
256
257 --insecure-skip-tls-verify=false
258 If true, the server's certificate will not be checked for validity.
259 This will make your HTTPS connections insecure
260
261
262 --kubeconfig=""
263 Path to the kubeconfig file to use for CLI requests.
264
265
266 --log-backtrace-at=:0
267 when logging hits line file:N, emit a stack trace
268
269
270 --log-cadvisor-usage=false
271 Whether to log the usage of the cAdvisor container
272
273
274 --log-dir=""
275 If non-empty, write log files in this directory
276
277
278 --log-flush-frequency=5s
279 Maximum number of seconds between log flushes
280
281
282 --logtostderr=true
283 log to standard error instead of files
284
285
286 --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
287 Comma-separated list of files to check for machine-id. Use the
288 first one that exists.
289
290
291 --match-server-version=false
292 Require server version to match client version
293
294
295 --mesos-agent="127.0.0.1:5051"
296 Mesos agent address
297
298
299 --mesos-agent-timeout=10s
300 Mesos agent timeout
301
302
303 -n, --namespace=""
304 If present, the namespace scope for this CLI request
305
306
307 --request-timeout="0"
308 The length of time to wait before giving up on a single server
309 request. Non-zero values should contain a corresponding time unit (e.g.
310 1s, 2m, 3h). A value of zero means don't timeout requests.
311
312
313 -s, --server=""
314 The address and port of the Kubernetes API server
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 --user=""
355 The name of the kubeconfig user to use
356
357
358 -v, --v=0
359 log level for V logs
360
361
362 --version=false
363 Print version information and quit
364
365
366 --vmodule=
367 comma-separated list of pattern=N settings for file-filtered log‐
368 ging
369
370
371
373 # Edit the service named 'docker-registry':
374 kubectl edit svc/docker-registry
375
376 # Use an alternative editor
377 KUBE_EDITOR="nano" kubectl edit svc/docker-registry
378
379 # Edit the job 'myjob' in JSON using the v1 API format:
380 kubectl edit job.v1.batch/myjob -o json
381
382 # Edit the deployment 'mydeployment' in YAML and save the modified config in its annotation:
383 kubectl edit deployment/mydeployment -o yaml --save-config
384
385
386
387
389 kubectl(1),
390
391
392
394 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
395 com) based on the kubernetes source material, but hopefully they have
396 been automatically generated since!
397
398
399
400Eric Paris kubernetes User Manuals KUBERNETES(1)