forked from kubernetes-sigs/reference-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kubectl.yaml
11247 lines (11247 loc) · 522 KB
/
kubectl.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
toplevelcommandgroups:
- commands:
- maincommand:
name: annotate
synopsis: Update the annotations on a resource
description: "Update the annotations on one or more resources. \n\n * An annotation
is a key/value pair that can hold larger (compared to a label), and possibly
not human-readable, data. \n * It is intended to store non-identifying auxiliary
data, especially data manipulated by tools and system extensions. \n * If
--overwrite is true, then existing annotations can be overwritten, otherwise
attempting to overwrite an annotation will result in an error. \n * If --resource-version
is specified, then updates will use this resource version, otherwise the existing
resource-version will be used. \n\nValid resource types include: \n\n *
all \n * certificatesigningrequests (aka 'csr') \n * clusterrolebindings
\ \n * clusterroles \n * clusters (valid only for federation apiservers)
\ \n * componentstatuses (aka 'cs') \n * configmaps (aka 'cm') \n * controllerrevisions
\ \n * cronjobs \n * daemonsets (aka 'ds') \n * deployments (aka 'deploy')
\ \n * endpoints (aka 'ep') \n * events (aka 'ev') \n * horizontalpodautoscalers
(aka 'hpa') \n * ingresses (aka 'ing') \n * jobs \n * limitranges (aka
'limits') \n * namespaces (aka 'ns') \n * networkpolicies (aka 'netpol')
\ \n * nodes (aka 'no') \n * persistentvolumeclaims (aka 'pvc') \n *
persistentvolumes (aka 'pv') \n * poddisruptionbudgets (aka 'pdb') \n *
podpreset \n * pods (aka 'po') \n * podsecuritypolicies (aka 'psp') \n
\ * podtemplates \n * replicasets (aka 'rs') \n * replicationcontrollers
(aka 'rc') \n * resourcequotas (aka 'quota') \n * rolebindings \n *
roles \n * secrets \n * serviceaccounts (aka 'sa') \n * services (aka
'svc') \n * statefulsets \n * storageclasses \n * thirdpartyresources"
options:
- name: all
default_value: "false"
usage: select all resources in the namespace of the specified resource types
- name: allow-missing-template-keys
default_value: "true"
usage: If true, ignore any errors in templates when a field or map key is
missing in the template. Only applies to golang and jsonpath output formats.
- name: dry-run
default_value: "false"
usage: If true, only print the object that would be sent, without sending
it.
- name: filename
shorthand: f
default_value: '[]'
usage: Filename, directory, or URL to files identifying the resource to update
the annotation
- name: include-extended-apis
default_value: "true"
usage: If true, include definitions of new APIs via calls to the API server.
[default true]
- name: local
default_value: "false"
usage: If true, annotation will NOT contact api-server but run locally.
- name: no-headers
default_value: "false"
usage: When using the default or custom-column output format, don't print
headers (default print headers).
- name: output
shorthand: o
usage: 'Output format. One of: json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...
See custom columns [http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns],
golang template [http://golang.org/pkg/text/template/#pkg-overview] and
jsonpath template [http://kubernetes.io/docs/user-guide/jsonpath].'
- name: output-version
usage: 'DEPRECATED: To use a specific API version, fully-qualify the resource,
version, and group (for example: ''jobs.v1.batch/myjob'').'
- name: overwrite
default_value: "false"
usage: If true, allow annotations to be overwritten, otherwise reject annotation
updates that overwrite existing annotations.
- name: record
default_value: "false"
usage: Record current kubectl command in the resource annotation. If set to
false, do not record the command. If set to true, record the command. If
not set, default to updating the existing annotation value only if one already
exists.
- name: recursive
shorthand: R
default_value: "false"
usage: Process the directory used in -f, --filename recursively. Useful when
you want to manage related manifests organized within the same directory.
- name: resource-version
usage: If non-empty, the annotation update will only succeed if this is the
current resource-version for the object. Only valid when specifying a single
resource.
- name: selector
shorthand: l
usage: Selector (label query) to filter on, supports '=', '==', and '!='.
- name: show-all
shorthand: a
default_value: "false"
usage: When printing, show all resources (default hide terminated pods.)
- name: show-labels
default_value: "false"
usage: When printing, show all labels as the last column (default hide labels
column)
- name: sort-by
usage: If non-empty, sort list types using this field specification. The
field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}').
The field in the API resource specified by this JSONPath expression must
be an integer or a string.
- name: template
usage: Template string or path to template file to use when -o=go-template,
-o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
inherited_options:
- name: alsologtostderr
default_value: "false"
usage: log to standard error as well as files
- name: as
usage: Username to impersonate for the operation
- name: as-group
default_value: '[]'
usage: Group to impersonate for the operation, this flag can be repeated to
specify multiple groups.
- name: certificate-authority
usage: Path to a cert file for the certificate authority
- name: client-certificate
usage: Path to a client certificate file for TLS
- name: client-key
usage: Path to a client key file for TLS
- name: cluster
usage: The name of the kubeconfig cluster to use
- name: context
usage: The name of the kubeconfig context to use
- name: insecure-skip-tls-verify
default_value: "false"
usage: If true, the server's certificate will not be checked for validity.
This will make your HTTPS connections insecure
- name: kubeconfig
usage: Path to the kubeconfig file to use for CLI requests.
- name: log-backtrace-at
default_value: :0
usage: when logging hits line file:N, emit a stack trace
- name: log-dir
usage: If non-empty, write log files in this directory
- name: logtostderr
default_value: "false"
usage: log to standard error instead of files
- name: match-server-version
default_value: "false"
usage: Require server version to match client version
- name: namespace
shorthand: "n"
usage: If present, the namespace scope for this CLI request
- name: password
usage: Password for basic authentication to the API server
- name: request-timeout
default_value: "0"
usage: The length of time to wait before giving up on a single server request.
Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h).
A value of zero means don't timeout requests.
- name: server
shorthand: s
usage: The address and port of the Kubernetes API server
- name: stderrthreshold
default_value: "2"
usage: logs at or above this threshold go to stderr
- name: token
usage: Bearer token for authentication to the API server
- name: user
usage: The name of the kubeconfig user to use
- name: username
usage: Username for basic authentication to the API server
- name: v
shorthand: v
default_value: "0"
usage: log level for V logs
- name: vmodule
usage: comma-separated list of pattern=N settings for file-filtered logging
example: " # Update pod 'foo' with the annotation 'description' and the value
'my frontend'.\n # If the same annotation is set multiple times, only the
last value will be applied\n kubectl annotate pods foo description='my frontend'\n
\ \n # Update a pod identified by type and name in \"pod.json\"\n kubectl
annotate -f pod.json description='my frontend'\n \n # Update pod 'foo' with
the annotation 'description' and the value 'my frontend running nginx', overwriting
any existing value.\n kubectl annotate --overwrite pods foo description='my
frontend running nginx'\n \n # Update all pods in the namespace\n kubectl
annotate pods --all description='my frontend running nginx'\n \n # Update
pod 'foo' only if the resource is unchanged from version 1.\n kubectl annotate
pods foo description='my frontend running nginx' --resource-version=1\n \n
\ # Update pod 'foo' by removing an annotation named 'description' if it exists.\n
\ # Does not require the --overwrite flag.\n kubectl annotate pods foo description-"
usage: annotate [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N
[--resource-version=version]
- maincommand:
name: api-versions
synopsis: Print the supported API versions on the server, in the form of "group/version"
description: Print the supported API versions on the server, in the form of
"group/version"
inherited_options:
- name: alsologtostderr
default_value: "false"
usage: log to standard error as well as files
- name: as
usage: Username to impersonate for the operation
- name: as-group
default_value: '[]'
usage: Group to impersonate for the operation, this flag can be repeated to
specify multiple groups.
- name: certificate-authority
usage: Path to a cert file for the certificate authority
- name: client-certificate
usage: Path to a client certificate file for TLS
- name: client-key
usage: Path to a client key file for TLS
- name: cluster
usage: The name of the kubeconfig cluster to use
- name: context
usage: The name of the kubeconfig context to use
- name: insecure-skip-tls-verify
default_value: "false"
usage: If true, the server's certificate will not be checked for validity.
This will make your HTTPS connections insecure
- name: kubeconfig
usage: Path to the kubeconfig file to use for CLI requests.
- name: log-backtrace-at
default_value: :0
usage: when logging hits line file:N, emit a stack trace
- name: log-dir
usage: If non-empty, write log files in this directory
- name: logtostderr
default_value: "false"
usage: log to standard error instead of files
- name: match-server-version
default_value: "false"
usage: Require server version to match client version
- name: namespace
shorthand: "n"
usage: If present, the namespace scope for this CLI request
- name: output
default_value: kubectl.yaml
usage: Destination for kubectl yaml representation.
- name: password
usage: Password for basic authentication to the API server
- name: request-timeout
default_value: "0"
usage: The length of time to wait before giving up on a single server request.
Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h).
A value of zero means don't timeout requests.
- name: server
shorthand: s
usage: The address and port of the Kubernetes API server
- name: stderrthreshold
default_value: "2"
usage: logs at or above this threshold go to stderr
- name: token
usage: Bearer token for authentication to the API server
- name: user
usage: The name of the kubeconfig user to use
- name: username
usage: Username for basic authentication to the API server
- name: v
shorthand: v
default_value: "0"
usage: log level for V logs
- name: vmodule
usage: comma-separated list of pattern=N settings for file-filtered logging
example: |2-
# Print the supported API versions
kubectl api-versions
usage: api-versions
- maincommand:
name: apiversions
synopsis: Print the supported API versions on the server, in the form of "group/version"
description: Print the supported API versions on the server, in the form of
"group/version"
inherited_options:
- name: alsologtostderr
default_value: "false"
usage: log to standard error as well as files
- name: as
usage: Username to impersonate for the operation
- name: as-group
default_value: '[]'
usage: Group to impersonate for the operation, this flag can be repeated to
specify multiple groups.
- name: certificate-authority
usage: Path to a cert file for the certificate authority
- name: client-certificate
usage: Path to a client certificate file for TLS
- name: client-key
usage: Path to a client key file for TLS
- name: cluster
usage: The name of the kubeconfig cluster to use
- name: context
usage: The name of the kubeconfig context to use
- name: insecure-skip-tls-verify
default_value: "false"
usage: If true, the server's certificate will not be checked for validity.
This will make your HTTPS connections insecure
- name: kubeconfig
usage: Path to the kubeconfig file to use for CLI requests.
- name: log-backtrace-at
default_value: :0
usage: when logging hits line file:N, emit a stack trace
- name: log-dir
usage: If non-empty, write log files in this directory
- name: logtostderr
default_value: "false"
usage: log to standard error instead of files
- name: match-server-version
default_value: "false"
usage: Require server version to match client version
- name: namespace
shorthand: "n"
usage: If present, the namespace scope for this CLI request
- name: output
default_value: kubectl.yaml
usage: Destination for kubectl yaml representation.
- name: password
usage: Password for basic authentication to the API server
- name: request-timeout
default_value: "0"
usage: The length of time to wait before giving up on a single server request.
Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h).
A value of zero means don't timeout requests.
- name: server
shorthand: s
usage: The address and port of the Kubernetes API server
- name: stderrthreshold
default_value: "2"
usage: logs at or above this threshold go to stderr
- name: token
usage: Bearer token for authentication to the API server
- name: user
usage: The name of the kubeconfig user to use
- name: username
usage: Username for basic authentication to the API server
- name: v
shorthand: v
default_value: "0"
usage: log level for V logs
- name: vmodule
usage: comma-separated list of pattern=N settings for file-filtered logging
example: |2-
# Print the supported API versions
kubectl api-versions
usage: apiversions
- maincommand:
name: apply
synopsis: Apply a configuration to a resource by filename or stdin
description: "Apply a configuration to a resource by filename or stdin. The
resource name must be specified. This resource will be created if it doesn't
exist yet. To use 'apply', always create the resource initially with either
'apply' or 'create --save-config'. \n\nJSON and YAML formats are accepted.
\n\nAlpha Disclaimer: the --prune functionality is not yet complete. Do not
use unless you are aware of what the current state is. See https://issues.k8s.io/34274."
options:
- name: all
default_value: "false"
usage: select all resources in the namespace of the specified resource types.
- name: allow-missing-template-keys
default_value: "true"
usage: If true, ignore any errors in templates when a field or map key is
missing in the template. Only applies to golang and jsonpath output formats.
- name: cascade
default_value: "true"
usage: Only relevant during a prune or a force apply. If true, cascade the
deletion of the resources managed by pruned or deleted resources (e.g. Pods
created by a ReplicationController).
- name: dry-run
default_value: "false"
usage: If true, only print the object that would be sent, without sending
it.
- name: filename
shorthand: f
default_value: '[]'
usage: Filename, directory, or URL to files that contains the configuration
to apply
- name: force
default_value: "false"
usage: Delete and re-create the specified resource, when PATCH encounters
conflict and has retried for 5 times.
- name: grace-period
default_value: "-1"
usage: Only relevant during a prune or a force apply. Period of time in seconds
given to pruned or deleted resources to terminate gracefully. Ignored if
negative.
- name: include-extended-apis
default_value: "true"
usage: If true, include definitions of new APIs via calls to the API server.
[default true]
- name: no-headers
default_value: "false"
usage: When using the default or custom-column output format, don't print
headers (default print headers).
- name: output
shorthand: o
usage: 'Output format. One of: json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...
See custom columns [http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns],
golang template [http://golang.org/pkg/text/template/#pkg-overview] and
jsonpath template [http://kubernetes.io/docs/user-guide/jsonpath].'
- name: output-version
usage: 'DEPRECATED: To use a specific API version, fully-qualify the resource,
version, and group (for example: ''jobs.v1.batch/myjob'').'
- name: overwrite
default_value: "true"
usage: Automatically resolve conflicts between the modified and live configuration
by using values from the modified configuration
- name: prune
default_value: "false"
usage: Automatically delete resource objects that do not appear in the configs
and are created by either apply or create --save-config. Should be used
with either -l or --all.
- name: prune-whitelist
default_value: '[]'
usage: Overwrite the default whitelist with <group/version/kind> for --prune
- name: record
default_value: "false"
usage: Record current kubectl command in the resource annotation. If set to
false, do not record the command. If set to true, record the command. If
not set, default to updating the existing annotation value only if one already
exists.
- name: recursive
shorthand: R
default_value: "false"
usage: Process the directory used in -f, --filename recursively. Useful when
you want to manage related manifests organized within the same directory.
- name: schema-cache-dir
default_value: ~/.kube/schema
usage: If non-empty, load/store cached API schemas in this directory, default
is '$HOME/.kube/schema'
- name: selector
shorthand: l
usage: Selector (label query) to filter on, supports '=', '==', and '!='.
- name: show-all
shorthand: a
default_value: "false"
usage: When printing, show all resources (default hide terminated pods.)
- name: show-labels
default_value: "false"
usage: When printing, show all labels as the last column (default hide labels
column)
- name: sort-by
usage: If non-empty, sort list types using this field specification. The
field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}').
The field in the API resource specified by this JSONPath expression must
be an integer or a string.
- name: template
usage: Template string or path to template file to use when -o=go-template,
-o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
- name: timeout
default_value: 0s
usage: Only relevant during a force apply. The length of time to wait before
giving up on a delete of the old resource, zero means determine a timeout
from the size of the object. Any other values should contain a corresponding
time unit (e.g. 1s, 2m, 3h).
- name: validate
default_value: "true"
usage: If true, use a schema to validate the input before sending it
inherited_options:
- name: alsologtostderr
default_value: "false"
usage: log to standard error as well as files
- name: as
usage: Username to impersonate for the operation
- name: as-group
default_value: '[]'
usage: Group to impersonate for the operation, this flag can be repeated to
specify multiple groups.
- name: certificate-authority
usage: Path to a cert file for the certificate authority
- name: client-certificate
usage: Path to a client certificate file for TLS
- name: client-key
usage: Path to a client key file for TLS
- name: cluster
usage: The name of the kubeconfig cluster to use
- name: context
usage: The name of the kubeconfig context to use
- name: insecure-skip-tls-verify
default_value: "false"
usage: If true, the server's certificate will not be checked for validity.
This will make your HTTPS connections insecure
- name: kubeconfig
usage: Path to the kubeconfig file to use for CLI requests.
- name: log-backtrace-at
default_value: :0
usage: when logging hits line file:N, emit a stack trace
- name: log-dir
usage: If non-empty, write log files in this directory
- name: logtostderr
default_value: "false"
usage: log to standard error instead of files
- name: match-server-version
default_value: "false"
usage: Require server version to match client version
- name: namespace
shorthand: "n"
usage: If present, the namespace scope for this CLI request
- name: password
usage: Password for basic authentication to the API server
- name: request-timeout
default_value: "0"
usage: The length of time to wait before giving up on a single server request.
Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h).
A value of zero means don't timeout requests.
- name: server
shorthand: s
usage: The address and port of the Kubernetes API server
- name: stderrthreshold
default_value: "2"
usage: logs at or above this threshold go to stderr
- name: token
usage: Bearer token for authentication to the API server
- name: user
usage: The name of the kubeconfig user to use
- name: username
usage: Username for basic authentication to the API server
- name: v
shorthand: v
default_value: "0"
usage: log level for V logs
- name: vmodule
usage: comma-separated list of pattern=N settings for file-filtered logging
example: " # Apply the configuration in pod.json to a pod.\n kubectl apply
-f ./pod.json\n \n # Apply the JSON passed into stdin to a pod.\n cat pod.json
| kubectl apply -f -\n \n # Note: --prune is still in Alpha\n # Apply the
configuration in manifest.yaml that matches label app=nginx and delete all
the other resources that are not in the file and match label app=nginx.\n
\ kubectl apply --prune -f manifest.yaml -l app=nginx\n \n # Apply the configuration
in manifest.yaml and delete all the other configmaps that are not in the file.\n
\ kubectl apply --prune -f manifest.yaml --all --prune-whitelist=core/v1/ConfigMap"
usage: apply -f FILENAME
subcommands:
- name: edit-last-applied
path: edit-last-applied
synopsis: Edit latest last-applied-configuration annotations of a resource/object
description: "Edit the latest last-applied-configuration annotations of resources
from the default editor. \n\nThe edit-last-applied command allows you to directly
edit any API resource you can retrieve via the command line tools. It will
open the editor defined by your KUBE _EDITOR, or EDITOR environment variables,
or fall back to 'vi' for Linux or 'notepad' for Windows. You can edit multiple
objects, although changes are applied one at a time. The command accepts filenames
as well as command line arguments, although the files you point to must be
previously saved versions of resources. \n\nThe default format is YAML. To
edit in JSON, specify \"-o json\". \n\nThe flag --windows-line-endings can
be used to force Windows line endings, otherwise the default for your operating
system will be used. \n\nIn the event an error occurs while updating, a temporary
file will be created on disk that contains your unapplied changes. The most
common error when updating a resource is another editor changing the resource
on the server. When this occurs, you will have to apply your changes to the
newer version of the resource, or update your temporary saved copy to include
the latest resource version."
options:
- name: filename
shorthand: f
default_value: '[]'
usage: Filename, directory, or URL to files to use to edit the resource
- name: output
shorthand: o
default_value: yaml
usage: 'Output format. One of: yaml|json.'
- name: record
default_value: "false"
usage: Record current kubectl command in the resource annotation. If set to
false, do not record the command. If set to true, record the command. If
not set, default to updating the existing annotation value only if one already
exists.
- name: recursive
shorthand: R
default_value: "false"
usage: Process the directory used in -f, --filename recursively. Useful when
you want to manage related manifests organized within the same directory.
- name: windows-line-endings
default_value: "false"
usage: Use Windows line-endings (default Unix line-endings)
inherited_options:
- name: alsologtostderr
default_value: "false"
usage: log to standard error as well as files
- name: as
usage: Username to impersonate for the operation
- name: as-group
default_value: '[]'
usage: Group to impersonate for the operation, this flag can be repeated to
specify multiple groups.
- name: certificate-authority
usage: Path to a cert file for the certificate authority
- name: client-certificate
usage: Path to a client certificate file for TLS
- name: client-key
usage: Path to a client key file for TLS
- name: cluster
usage: The name of the kubeconfig cluster to use
- name: context
usage: The name of the kubeconfig context to use
- name: insecure-skip-tls-verify
default_value: "false"
usage: If true, the server's certificate will not be checked for validity.
This will make your HTTPS connections insecure
- name: kubeconfig
usage: Path to the kubeconfig file to use for CLI requests.
- name: log-backtrace-at
default_value: :0
usage: when logging hits line file:N, emit a stack trace
- name: log-dir
usage: If non-empty, write log files in this directory
- name: logtostderr
default_value: "false"
usage: log to standard error instead of files
- name: match-server-version
default_value: "false"
usage: Require server version to match client version
- name: namespace
shorthand: "n"
usage: If present, the namespace scope for this CLI request
- name: password
usage: Password for basic authentication to the API server
- name: request-timeout
default_value: "0"
usage: The length of time to wait before giving up on a single server request.
Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h).
A value of zero means don't timeout requests.
- name: server
shorthand: s
usage: The address and port of the Kubernetes API server
- name: stderrthreshold
default_value: "2"
usage: logs at or above this threshold go to stderr
- name: token
usage: Bearer token for authentication to the API server
- name: user
usage: The name of the kubeconfig user to use
- name: username
usage: Username for basic authentication to the API server
- name: v
shorthand: v
default_value: "0"
usage: log level for V logs
- name: vmodule
usage: comma-separated list of pattern=N settings for file-filtered logging
example: " # Edit the last-applied-configuration annotations by type/name in
YAML.\n kubectl apply edit-last-applied deployment/nginx\n \n # Edit the
last-applied-configuration annotations by file in JSON.\n kubectl apply edit-last-applied
-f deploy.yaml -o json"
usage: edit-last-applied (RESOURCE/NAME | -f FILENAME)
- name: set-last-applied
path: set-last-applied
synopsis: Set the last-applied-configuration annotation on a live object to
match the contents of a file.
description: Set the latest last-applied-configuration annotations by setting
it to match the contents of a file. This results in the last-applied-configuration
being updated as though 'kubectl apply -f <file>' was run, without updating
any other parts of the object.
options:
- name: allow-missing-template-keys
default_value: "true"
usage: If true, ignore any errors in templates when a field or map key is
missing in the template. Only applies to golang and jsonpath output formats.
- name: create-annotation
default_value: "false"
usage: Will create 'last-applied-configuration' annotations if current objects
doesn't have one
- name: dry-run
default_value: "false"
usage: If true, only print the object that would be sent, without sending
it.
- name: filename
shorthand: f
default_value: '[]'
usage: Filename, directory, or URL to files that contains the last-applied-configuration
annotations
- name: no-headers
default_value: "false"
usage: When using the default or custom-column output format, don't print
headers (default print headers).
- name: output
shorthand: o
usage: 'Output format. One of: json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...
See custom columns [http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns],
golang template [http://golang.org/pkg/text/template/#pkg-overview] and
jsonpath template [http://kubernetes.io/docs/user-guide/jsonpath].'
- name: output-version
usage: 'DEPRECATED: To use a specific API version, fully-qualify the resource,
version, and group (for example: ''jobs.v1.batch/myjob'').'
- name: record
default_value: "false"
usage: Record current kubectl command in the resource annotation. If set to
false, do not record the command. If set to true, record the command. If
not set, default to updating the existing annotation value only if one already
exists.
- name: show-all
shorthand: a
default_value: "false"
usage: When printing, show all resources (default hide terminated pods.)
- name: show-labels
default_value: "false"
usage: When printing, show all labels as the last column (default hide labels
column)
- name: sort-by
usage: If non-empty, sort list types using this field specification. The
field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}').
The field in the API resource specified by this JSONPath expression must
be an integer or a string.
- name: template
usage: Template string or path to template file to use when -o=go-template,
-o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
inherited_options:
- name: alsologtostderr
default_value: "false"
usage: log to standard error as well as files
- name: as
usage: Username to impersonate for the operation
- name: as-group
default_value: '[]'
usage: Group to impersonate for the operation, this flag can be repeated to
specify multiple groups.
- name: certificate-authority
usage: Path to a cert file for the certificate authority
- name: client-certificate
usage: Path to a client certificate file for TLS
- name: client-key
usage: Path to a client key file for TLS
- name: cluster
usage: The name of the kubeconfig cluster to use
- name: context
usage: The name of the kubeconfig context to use
- name: insecure-skip-tls-verify
default_value: "false"
usage: If true, the server's certificate will not be checked for validity.
This will make your HTTPS connections insecure
- name: kubeconfig
usage: Path to the kubeconfig file to use for CLI requests.
- name: log-backtrace-at
default_value: :0
usage: when logging hits line file:N, emit a stack trace
- name: log-dir
usage: If non-empty, write log files in this directory
- name: logtostderr
default_value: "false"
usage: log to standard error instead of files
- name: match-server-version
default_value: "false"
usage: Require server version to match client version
- name: namespace
shorthand: "n"
usage: If present, the namespace scope for this CLI request
- name: password
usage: Password for basic authentication to the API server
- name: request-timeout
default_value: "0"
usage: The length of time to wait before giving up on a single server request.
Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h).
A value of zero means don't timeout requests.
- name: server
shorthand: s
usage: The address and port of the Kubernetes API server
- name: stderrthreshold
default_value: "2"
usage: logs at or above this threshold go to stderr
- name: token
usage: Bearer token for authentication to the API server
- name: user
usage: The name of the kubeconfig user to use
- name: username
usage: Username for basic authentication to the API server
- name: v
shorthand: v
default_value: "0"
usage: log level for V logs
- name: vmodule
usage: comma-separated list of pattern=N settings for file-filtered logging
example: " # Set the last-applied-configuration of a resource to match the
contents of a file.\n kubectl apply set-last-applied -f deploy.yaml\n \n
\ # Execute set-last-applied against each configuration file in a directory.\n
\ kubectl apply set-last-applied -f path/\n \n # Set the last-applied-configuration
of a resource to match the contents of a file, will create the annotation
if it does not already exist.\n kubectl apply set-last-applied -f deploy.yaml
--create-annotation=true"
usage: set-last-applied -f FILENAME
- name: view-last-applied
path: view-last-applied
synopsis: View latest last-applied-configuration annotations of a resource/object
description: "View the latest last-applied-configuration annotations by type/name
or file. \n\nThe default output will be printed to stdout in YAML format.
One can use -o option to change output format."
options:
- name: all
default_value: "false"
usage: select all resources in the namespace of the specified resource types
- name: filename
shorthand: f
default_value: '[]'
usage: Filename, directory, or URL to files that contains the last-applied-configuration
annotations
- name: output
shorthand: o
usage: Output format. Must be one of yaml|json
- name: recursive
shorthand: R
default_value: "false"
usage: Process the directory used in -f, --filename recursively. Useful when
you want to manage related manifests organized within the same directory.
- name: selector
shorthand: l
usage: Selector (label query) to filter on, supports '=', '==', and '!='.
inherited_options:
- name: alsologtostderr
default_value: "false"
usage: log to standard error as well as files
- name: as
usage: Username to impersonate for the operation
- name: as-group
default_value: '[]'
usage: Group to impersonate for the operation, this flag can be repeated to
specify multiple groups.
- name: certificate-authority
usage: Path to a cert file for the certificate authority
- name: client-certificate
usage: Path to a client certificate file for TLS
- name: client-key
usage: Path to a client key file for TLS
- name: cluster
usage: The name of the kubeconfig cluster to use
- name: context
usage: The name of the kubeconfig context to use
- name: insecure-skip-tls-verify
default_value: "false"
usage: If true, the server's certificate will not be checked for validity.
This will make your HTTPS connections insecure
- name: kubeconfig
usage: Path to the kubeconfig file to use for CLI requests.
- name: log-backtrace-at
default_value: :0
usage: when logging hits line file:N, emit a stack trace
- name: log-dir
usage: If non-empty, write log files in this directory
- name: logtostderr
default_value: "false"
usage: log to standard error instead of files
- name: match-server-version
default_value: "false"
usage: Require server version to match client version
- name: namespace
shorthand: "n"
usage: If present, the namespace scope for this CLI request
- name: password
usage: Password for basic authentication to the API server
- name: request-timeout
default_value: "0"
usage: The length of time to wait before giving up on a single server request.
Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h).
A value of zero means don't timeout requests.
- name: server
shorthand: s
usage: The address and port of the Kubernetes API server
- name: stderrthreshold
default_value: "2"
usage: logs at or above this threshold go to stderr
- name: token
usage: Bearer token for authentication to the API server
- name: user
usage: The name of the kubeconfig user to use
- name: username
usage: Username for basic authentication to the API server
- name: v
shorthand: v
default_value: "0"
usage: log level for V logs
- name: vmodule
usage: comma-separated list of pattern=N settings for file-filtered logging
example: " # View the last-applied-configuration annotations by type/name in
YAML.\n kubectl apply view-last-applied deployment/nginx\n \n # View the
last-applied-configuration annotations by file in JSON\n kubectl apply view-last-applied
-f deploy.yaml -o json"
usage: view-last-applied (TYPE [NAME | -l label] | TYPE/NAME | -f FILENAME)
- maincommand:
name: attach
synopsis: Attach to a running container
description: Attach to a process that is already running inside an existing
container.
options:
- name: container
shorthand: c
usage: Container name. If omitted, the first container in the pod will be
chosen
- name: pod-running-timeout
default_value: 1m0s
usage: The length of time (like 5s, 2m, or 3h, higher than zero) to wait until
at least one pod is running
- name: stdin
shorthand: i
default_value: "false"
usage: Pass stdin to the container
- name: tty
shorthand: t
default_value: "false"
usage: Stdin is a TTY
inherited_options:
- name: alsologtostderr
default_value: "false"
usage: log to standard error as well as files
- name: as
usage: Username to impersonate for the operation
- name: as-group
default_value: '[]'
usage: Group to impersonate for the operation, this flag can be repeated to
specify multiple groups.
- name: certificate-authority
usage: Path to a cert file for the certificate authority
- name: client-certificate
usage: Path to a client certificate file for TLS
- name: client-key
usage: Path to a client key file for TLS
- name: cluster
usage: The name of the kubeconfig cluster to use
- name: context
usage: The name of the kubeconfig context to use
- name: insecure-skip-tls-verify
default_value: "false"
usage: If true, the server's certificate will not be checked for validity.
This will make your HTTPS connections insecure
- name: kubeconfig
usage: Path to the kubeconfig file to use for CLI requests.
- name: log-backtrace-at
default_value: :0
usage: when logging hits line file:N, emit a stack trace
- name: log-dir
usage: If non-empty, write log files in this directory
- name: logtostderr
default_value: "false"
usage: log to standard error instead of files
- name: match-server-version
default_value: "false"
usage: Require server version to match client version
- name: namespace
shorthand: "n"
usage: If present, the namespace scope for this CLI request
- name: output
default_value: kubectl.yaml
usage: Destination for kubectl yaml representation.
- name: password
usage: Password for basic authentication to the API server
- name: request-timeout
default_value: "0"
usage: The length of time to wait before giving up on a single server request.
Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h).
A value of zero means don't timeout requests.
- name: server
shorthand: s
usage: The address and port of the Kubernetes API server
- name: stderrthreshold
default_value: "2"
usage: logs at or above this threshold go to stderr
- name: token
usage: Bearer token for authentication to the API server
- name: user
usage: The name of the kubeconfig user to use
- name: username
usage: Username for basic authentication to the API server
- name: v
shorthand: v
default_value: "0"
usage: log level for V logs
- name: vmodule
usage: comma-separated list of pattern=N settings for file-filtered logging
example: " # Get output from running pod 123456-7890, using the first container
by default\n kubectl attach 123456-7890\n \n # Get output from ruby-container
from pod 123456-7890\n kubectl attach 123456-7890 -c ruby-container\n \n
\ # Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from
pod 123456-7890\n # and sends stdout/stderr from 'bash' back to the client\n
\ kubectl attach 123456-7890 -c ruby-container -i -t\n \n # Get output from
the first pod of a ReplicaSet named nginx\n kubectl attach rs/nginx"
usage: attach (POD | TYPE/NAME) -c CONTAINER
- maincommand:
name: auth
synopsis: Inspect authorization
description: Inspect authorization
inherited_options:
- name: alsologtostderr
default_value: "false"
usage: log to standard error as well as files
- name: as
usage: Username to impersonate for the operation
- name: as-group
default_value: '[]'
usage: Group to impersonate for the operation, this flag can be repeated to
specify multiple groups.
- name: certificate-authority
usage: Path to a cert file for the certificate authority
- name: client-certificate
usage: Path to a client certificate file for TLS
- name: client-key
usage: Path to a client key file for TLS
- name: cluster
usage: The name of the kubeconfig cluster to use
- name: context
usage: The name of the kubeconfig context to use
- name: insecure-skip-tls-verify
default_value: "false"
usage: If true, the server's certificate will not be checked for validity.
This will make your HTTPS connections insecure
- name: kubeconfig
usage: Path to the kubeconfig file to use for CLI requests.
- name: log-backtrace-at
default_value: :0
usage: when logging hits line file:N, emit a stack trace
- name: log-dir
usage: If non-empty, write log files in this directory
- name: logtostderr
default_value: "false"