-
Notifications
You must be signed in to change notification settings - Fork 2
/
kubectlCommandExplorer.html
212 lines (211 loc) · 210 KB
/
kubectlCommandExplorer.html
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
<!DOCTYPE html>
<html lang="en-gb">
<head>
<title>
Expandable Kubernetes API
</title>
<link rel="stylesheet" href="site.css" type="text/css">
<link rel="stylesheet" href="page.css" type="text/css">
<link rel="stylesheet" href="tooltip.css" type="text/css">
<!-- <link rel="icon" href="/favicon.png" type="image/png"> -->
</head>
<body>
<header>
</header>
<main>
<h1>
kubectl Command Explorer
</h1>
<H2>Basic Commands (Beginner)</H2>
<UL class="tree-padding tree-vertical-lines tree-horizontal-lines tree-summaries tree-markers tree-buttons">
<LI>
<details closed>
<summary><div class="tooltip">create <span class="tooltiptext">Create a resource from a file or from stdin.<BR><BR>JSON and YAML formats are accepted.<BR><BR>Examples:<BR># Create a pod using the data in pod.json<BR>kubectl create -f ./pod.json<BR><BR># Create a pod based on the JSON passed into stdin<BR>cat pod.json | kubectl create -f -<BR><BR># Edit the data in docker-registry.yaml in JSON then create the resource using the edited data<BR>kubectl create -f docker-registry.yaml --edit -o json<BR><BR>Available Commands:<BR>clusterrole Create a cluster role<BR>clusterrolebinding Create a cluster role binding for a particular cluster role<BR>configmap Create a config map from a local file, directory or literal value<BR>cronjob Create a cron job with the specified name<BR>deployment Create a deployment with the specified name<BR>ingress Create an ingress with the specified name<BR>job Create a job with the specified name<BR>namespace Create a namespace with the specified name<BR>poddisruptionbudget Create a pod disruption budget with the specified name<BR>priorityclass Create a priority class with the specified name<BR>quota Create a quota with the specified name<BR>role Create a role with single rule<BR>rolebinding Create a role binding for a particular role or cluster role<BR>secret Create a secret using specified subcommand<BR>service Create a service using a specified subcommand<BR>serviceaccount Create a service account with the specified name<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--edit=false: Edit the API resource before creating<BR>--field-manager='kubectl-create': Name of the manager used to track field ownership.<BR>-f, --filename=[]: Filename, directory, or URL to files to use to create the resource<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--raw='': Raw URI to POST to the server. Uses the transport specified by the kubeconfig file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--validate=true: If true, use a schema to validate the input before sending it<BR>--windows-line-endings=false: Only relevant if --edit=true. Defaults to the line ending native to your platform.<BR><BR>Usage:<BR>kubectl create -f FILENAME [options]<BR><BR>Use "kubectl (command) --help" for more information about a given command.<BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div></summary>
<UL>
<LI> <div class="tooltip">clusterrole <span class="tooltiptext">Create a cluster role.<BR><BR>Examples:<BR># Create a cluster role named "pod-reader" that allows user to perform "get", "watch" and "list" on pods<BR>kubectl create clusterrole pod-reader --verb=get,list,watch --resource=pods<BR><BR># Create a cluster role named "pod-reader" with ResourceName specified<BR>kubectl create clusterrole pod-reader --verb=get --resource=pods --resource-name=readablepod --resource-name=anotherpod<BR><BR># Create a cluster role named "foo" with API Group specified<BR>kubectl create clusterrole foo --verb=get,list,watch --resource=rs.extensions<BR><BR># Create a cluster role named "foo" with SubResource specified<BR>kubectl create clusterrole foo --verb=get,list,watch --resource=pods,pods/status<BR><BR># Create a cluster role name "foo" with NonResourceURL specified<BR>kubectl create clusterrole "foo" --verb=get --non-resource-url=/logs/*<BR><BR># Create a cluster role name "monitoring" with AggregationRule specified<BR>kubectl create clusterrole monitoring --aggregation-rule="rbac.example.com/aggregate-to-monitoring=true"<BR><BR>Options:<BR>--aggregation-rule=: An aggregation label selector for combining ClusterRoles.<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-create': Name of the manager used to track field ownership.<BR>--non-resource-url=[]: A partial url that user should have access to.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--resource=[]: Resource that the rule applies to<BR>--resource-name=[]: Resource in the white list that the rule applies to, repeat this flag for multiple items<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--validate=true: If true, use a schema to validate the input before sending it<BR>--verb=[]: Verb that applies to the resources contained in the rule<BR><BR>Usage:<BR>kubectl create clusterrole NAME --verb=verb --resource=resource.group [--resource-name=resourcename] [--dry-run=server|client|none] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">clusterrolebinding <span class="tooltiptext">Create a cluster role binding for a particular cluster role.<BR><BR>Examples:<BR># Create a cluster role binding for user1, user2, and group1 using the cluster-admin cluster role<BR>kubectl create clusterrolebinding cluster-admin --clusterrole=cluster-admin --user=user1 --user=user2 --group=group1<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--clusterrole='': ClusterRole this ClusterRoleBinding should reference<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-create': Name of the manager used to track field ownership.<BR>--group=[]: Groups to bind to the clusterrole<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--serviceaccount=[]: Service accounts to bind to the clusterrole, in the format (namespace):(name)<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--validate=true: If true, use a schema to validate the input before sending it<BR><BR>Usage:<BR>kubectl create clusterrolebinding NAME --clusterrole=NAME [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run=server|client|none] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">configmap <span class="tooltiptext">Create a config map based on a file, directory, or specified literal value.<BR><BR>A single config map may package one or more key/value pairs.<BR><BR>When creating a config map based on a file, the key will default to the basename of the file, and the value will default to the file content. If the basename is an invalid key, you may specify an alternate key.<BR><BR>When creating a config map based on a directory, each file whose basename is a valid key in the directory will be packaged into the config map. Any directory entries except regular files are ignored (e.g. subdirectories, symlinks, devices, pipes, etc).<BR><BR>Aliases:<BR>configmap, cm<BR><BR>Examples:<BR># Create a new config map named my-config based on folder bar<BR>kubectl create configmap my-config --from-file=path/to/bar<BR><BR># Create a new config map named my-config with specified keys instead of file basenames on disk<BR>kubectl create configmap my-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt<BR><BR># Create a new config map named my-config with key1=config1 and key2=config2<BR>kubectl create configmap my-config --from-literal=key1=config1 --from-literal=key2=config2<BR><BR># Create a new config map named my-config from the key=value pairs in the file<BR>kubectl create configmap my-config --from-file=path/to/bar<BR><BR># Create a new config map named my-config from an env file<BR>kubectl create configmap my-config --from-env-file=path/to/foo.env --from-env-file=path/to/bar.env<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--append-hash=false: Append a hash of the configmap to its name.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-create': Name of the manager used to track field ownership.<BR>--from-env-file=[]: Specify the path to a file to read lines of key=val pairs to create a configmap (i.e. a Docker .env file).<BR>--from-file=[]: Key file can be specified using its file path, in which case file basename will be used as configmap key, or optionally with a key and file path, in which case the given key will be used. Specifying a directory will iterate each named file in the directory whose basename is a valid configmap key.<BR>--from-literal=[]: Specify a key and literal value to insert in configmap (i.e. mykey=somevalue)<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--validate=true: If true, use a schema to validate the input before sending it<BR><BR>Usage:<BR>kubectl create configmap NAME [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run=server|client|none] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">cronjob <span class="tooltiptext">Create a cron job with the specified name.<BR><BR>Aliases:<BR>cronjob, cj<BR><BR>Examples:<BR># Create a cron job<BR>kubectl create cronjob my-job --image=busybox --schedule="*/1 * * * *"<BR><BR># Create a cron job with a command<BR>kubectl create cronjob my-job --image=busybox --schedule="*/1 * * * *" -- date<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-create': Name of the manager used to track field ownership.<BR>--image='': Image name to run.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--restart='': job's restart policy. supported values: OnFailure, Never<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--schedule='': A schedule in the Cron format the job should be run with.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--validate=true: If true, use a schema to validate the input before sending it<BR><BR>Usage:<BR>kubectl create cronjob NAME --image=image --schedule='0/5 * * * ?' -- [COMMAND] [args...] [flags] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">deployment <span class="tooltiptext">Create a deployment with the specified name.<BR><BR>Aliases:<BR>deployment, deploy<BR><BR>Examples:<BR># Create a deployment named my-dep that runs the busybox image<BR>kubectl create deployment my-dep --image=busybox<BR><BR># Create a deployment with a command<BR>kubectl create deployment my-dep --image=busybox -- date<BR><BR># Create a deployment named my-dep that runs the nginx image with 3 replicas<BR>kubectl create deployment my-dep --image=nginx --replicas=3<BR><BR># Create a deployment named my-dep that runs the busybox image and expose port 5701<BR>kubectl create deployment my-dep --image=busybox --port=5701<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-create': Name of the manager used to track field ownership.<BR>--image=[]: Image names to run.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--port=-1: The port that this container exposes.<BR>-r, --replicas=1: Number of replicas to create. Default is 1.<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--validate=true: If true, use a schema to validate the input before sending it<BR><BR>Usage:<BR>kubectl create deployment NAME --image=image -- [COMMAND] [args...] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">ingress <span class="tooltiptext">Create an ingress with the specified name.<BR><BR>Aliases:<BR>ingress, ing<BR><BR>Examples:<BR># Create a single ingress called 'simple' that directs requests to foo.com/bar to svc<BR># svc1:8080 with a tls secret "my-cert"<BR>kubectl create ingress simple --rule="foo.com/bar=svc1:8080,tls=my-cert"<BR><BR># Create a catch all ingress of "/path" pointing to service svc:port and Ingress Class as "otheringress"<BR>kubectl create ingress catch-all --class=otheringress --rule="/path=svc:port"<BR><BR># Create an ingress with two annotations: ingress.annotation1 and ingress.annotations2<BR>kubectl create ingress annotated --class=default --rule="foo.com/bar=svc:port" \<BR>--annotation ingress.annotation1=foo \<BR>--annotation ingress.annotation2=bla<BR><BR># Create an ingress with the same host and multiple paths<BR>kubectl create ingress multipath --class=default \<BR>--rule="foo.com/=svc:port" \<BR>--rule="foo.com/admin/=svcadmin:portadmin"<BR><BR># Create an ingress with multiple hosts and the pathType as Prefix<BR>kubectl create ingress ingress1 --class=default \<BR>--rule="foo.com/path*=svc:8080" \<BR>--rule="bar.com/admin*=svc2:http"<BR><BR># Create an ingress with TLS enabled using the default ingress certificate and different path types<BR>kubectl create ingress ingtls --class=default \<BR>--rule="foo.com/=svc:https,tls" \<BR>--rule="foo.com/path/subpath*=othersvc:8080"<BR><BR># Create an ingress with TLS enabled using a specific secret and pathType as Prefix<BR>kubectl create ingress ingsecret --class=default \<BR>--rule="foo.com/*=svc:8080,tls=secret1"<BR><BR># Create an ingress with a default backend<BR>kubectl create ingress ingdefault --class=default \<BR>--default-backend=defaultsvc:http \<BR>--rule="foo.com/*=svc:8080,tls=secret1"<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--annotation=[]: Annotation to insert in the ingress object, in the format annotation=value<BR>--class='': Ingress Class to be used<BR>--default-backend='': Default service for backend, in format of svcname:port<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-create': Name of the manager used to track field ownership.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--rule=[]: Rule in format host/path=service:port[,tls=secretname]. Paths containing the leading character '*' are considered pathType=Prefix. tls argument is optional.<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--validate=true: If true, use a schema to validate the input before sending it<BR><BR>Usage:<BR>kubectl create ingress NAME --rule=host/path=service:port[,tls[=secret]] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">job <span class="tooltiptext">Create a job with the specified name.<BR><BR>Examples:<BR># Create a job<BR>kubectl create job my-job --image=busybox<BR><BR># Create a job with a command<BR>kubectl create job my-job --image=busybox -- date<BR><BR># Create a job from a cron job named "a-cronjob"<BR>kubectl create job test-job --from=cronjob/a-cronjob<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-create': Name of the manager used to track field ownership.<BR>--from='': The name of the resource to create a Job from (only cronjob is supported).<BR>--image='': Image name to run.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--validate=true: If true, use a schema to validate the input before sending it<BR><BR>Usage:<BR>kubectl create job NAME --image=image [--from=cronjob/name] -- [COMMAND] [args...] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">namespace <span class="tooltiptext">Create a namespace with the specified name.<BR><BR>Aliases:<BR>namespace, ns<BR><BR>Examples:<BR># Create a new namespace named my-namespace<BR>kubectl create namespace my-namespace<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-create': Name of the manager used to track field ownership.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--validate=true: If true, use a schema to validate the input before sending it<BR><BR>Usage:<BR>kubectl create namespace NAME [--dry-run=server|client|none] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">poddisruptionbudget <span class="tooltiptext">Create a pod disruption budget with the specified name, selector, and desired minimum available pods.<BR><BR>Aliases:<BR>poddisruptionbudget, pdb<BR><BR>Examples:<BR># Create a pod disruption budget named my-pdb that will select all pods with the app=rails label<BR># and require at least one of them being available at any point in time<BR>kubectl create poddisruptionbudget my-pdb --selector=app=rails --min-available=1<BR><BR># Create a pod disruption budget named my-pdb that will select all pods with the app=nginx label<BR># and require at least half of the pods selected to be available at any point in time<BR>kubectl create pdb my-pdb --selector=app=nginx --min-available=50%<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-create': Name of the manager used to track field ownership.<BR>--max-unavailable='': The maximum number or percentage of unavailable pods this budget requires.<BR>--min-available='': The minimum number or percentage of available pods this budget requires.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--selector='': A label selector to use for this budget. Only equality-based selector requirements are supported.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--validate=true: If true, use a schema to validate the input before sending it<BR><BR>Usage:<BR>kubectl create poddisruptionbudget NAME --selector=SELECTOR --min-available=N [--dry-run=server|client|none] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">priorityclass <span class="tooltiptext">Create a priority class with the specified name, value, globalDefault and description.<BR><BR>Aliases:<BR>priorityclass, pc<BR><BR>Examples:<BR># Create a priority class named high-priority<BR>kubectl create priorityclass high-priority --value=1000 --description="high priority"<BR><BR># Create a priority class named default-priority that is considered as the global default priority<BR>kubectl create priorityclass default-priority --value=1000 --global-default=true --description="default priority"<BR><BR># Create a priority class named high-priority that cannot preempt pods with lower priority<BR>kubectl create priorityclass high-priority --value=1000 --description="high priority" --preemption-policy="Never"<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--description='': description is an arbitrary string that usually provides guidelines on when this priority class should be used.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-create': Name of the manager used to track field ownership.<BR>--global-default=false: global-default specifies whether this PriorityClass should be considered as the default priority.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--preemption-policy='PreemptLowerPriority': preemption-policy is the policy for preempting pods with lower priority.<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--validate=true: If true, use a schema to validate the input before sending it<BR>--value=0: the value of this priority class.<BR><BR>Usage:<BR>kubectl create priorityclass NAME --value=VALUE --global-default=BOOL [--dry-run=server|client|none] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">quota <span class="tooltiptext">Create a resource quota with the specified name, hard limits, and optional scopes.<BR><BR>Aliases:<BR>quota, resourcequota<BR><BR>Examples:<BR># Create a new resource quota named my-quota<BR>kubectl create quota my-quota --hard=cpu=1,memory=1G,pods=2,services=3,replicationcontrollers=2,resourcequotas=1,secrets=5,persistentvolumeclaims=10<BR><BR># Create a new resource quota named best-effort<BR>kubectl create quota best-effort --hard=pods=100 --scopes=BestEffort<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-create': Name of the manager used to track field ownership.<BR>--hard='': A comma-delimited set of resource=quantity pairs that define a hard limit.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--scopes='': A comma-delimited set of quota scopes that must all match each object tracked by the quota.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--validate=true: If true, use a schema to validate the input before sending it<BR><BR>Usage:<BR>kubectl create quota NAME [--hard=key1=value1,key2=value2] [--scopes=Scope1,Scope2] [--dry-run=server|client|none] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">role <span class="tooltiptext">Create a role with single rule.<BR><BR>Examples:<BR># Create a role named "pod-reader" that allows user to perform "get", "watch" and "list" on pods<BR>kubectl create role pod-reader --verb=get --verb=list --verb=watch --resource=pods<BR><BR># Create a role named "pod-reader" with ResourceName specified<BR>kubectl create role pod-reader --verb=get --resource=pods --resource-name=readablepod --resource-name=anotherpod<BR><BR># Create a role named "foo" with API Group specified<BR>kubectl create role foo --verb=get,list,watch --resource=rs.extensions<BR><BR># Create a role named "foo" with SubResource specified<BR>kubectl create role foo --verb=get,list,watch --resource=pods,pods/status<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-create': Name of the manager used to track field ownership.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--resource=[]: Resource that the rule applies to<BR>--resource-name=[]: Resource in the white list that the rule applies to, repeat this flag for multiple items<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--validate=true: If true, use a schema to validate the input before sending it<BR>--verb=[]: Verb that applies to the resources contained in the rule<BR><BR>Usage:<BR>kubectl create role NAME --verb=verb --resource=resource.group/subresource [--resource-name=resourcename] [--dry-run=server|client|none] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">rolebinding <span class="tooltiptext">Create a role binding for a particular role or cluster role.<BR><BR>Examples:<BR># Create a role binding for user1, user2, and group1 using the admin cluster role<BR>kubectl create rolebinding admin --clusterrole=admin --user=user1 --user=user2 --group=group1<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--clusterrole='': ClusterRole this RoleBinding should reference<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-create': Name of the manager used to track field ownership.<BR>--group=[]: Groups to bind to the role<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--role='': Role this RoleBinding should reference<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--serviceaccount=[]: Service accounts to bind to the role, in the format (namespace):(name)<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--validate=true: If true, use a schema to validate the input before sending it<BR><BR>Usage:<BR>kubectl create rolebinding NAME --clusterrole=NAME|--role=NAME [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run=server|client|none] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">secret <span class="tooltiptext">Create a secret using specified subcommand.<BR><BR>Available Commands:<BR>docker-registry Create a secret for use with a Docker registry<BR>generic Create a secret from a local file, directory, or literal value<BR>tls Create a TLS secret<BR><BR>Usage:<BR>kubectl create secret [flags] [options]<BR><BR>Use "kubectl (command) --help" for more information about a given command.<BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">service <span class="tooltiptext">Create a service using a specified subcommand.<BR><BR>Aliases:<BR>service, svc<BR><BR>Available Commands:<BR>clusterip Create a ClusterIP service<BR>externalname Create an ExternalName service<BR>loadbalancer Create a LoadBalancer service<BR>nodeport Create a NodePort service<BR><BR>Usage:<BR>kubectl create service [flags] [options]<BR><BR>Use "kubectl (command) --help" for more information about a given command.<BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">serviceaccount <span class="tooltiptext">Create a service account with the specified name.<BR><BR>Aliases:<BR>serviceaccount, sa<BR><BR>Examples:<BR># Create a new service account named my-service-account<BR>kubectl create serviceaccount my-service-account<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-create': Name of the manager used to track field ownership.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--validate=true: If true, use a schema to validate the input before sending it<BR><BR>Usage:<BR>kubectl create serviceaccount NAME [--dry-run=server|client|none] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
</UL>
</details>
</LI>
<LI> <div class="tooltip">expose <span class="tooltiptext">Expose a resource as a new Kubernetes service.<BR><BR>Looks up a deployment, service, replica set, replication controller or pod by name and uses the selector for that resource as the selector for a new service on the specified port. A deployment or replica set will be exposed as a service only if its selector is convertible to a selector that service supports, i.e. when the selector contains only the matchLabels component. Note that if no port is specified via --port and the exposed resource has multiple ports, all will be re-used by the new service. Also if no labels are specified, the new service will re-use the labels from the resource it exposes.<BR><BR>Possible resources include (case insensitive):<BR><BR>pod (po), service (svc), replicationcontroller (rc), deployment (deploy), replicaset (rs)<BR><BR>Examples:<BR># Create a service for a replicated nginx, which serves on port 80 and connects to the containers on port 8000<BR>kubectl expose rc nginx --port=80 --target-port=8000<BR><BR># Create a service for a replication controller identified by type and name specified in "nginx-controller.yaml", which serves on port 80 and connects to the containers on port 8000<BR>kubectl expose -f nginx-controller.yaml --port=80 --target-port=8000<BR><BR># Create a service for a pod valid-pod, which serves on port 444 with the name "frontend"<BR>kubectl expose pod valid-pod --port=444 --name=frontend<BR><BR># Create a second service based on the above service, exposing the container port 8443 as port 443 with the name "nginx-https"<BR>kubectl expose service nginx --port=443 --target-port=8443 --name=nginx-https<BR><BR># Create a service for a replicated streaming application on port 4100 balancing UDP traffic and named 'video-stream'.<BR>kubectl expose rc streamer --port=4100 --protocol=UDP --name=video-stream<BR><BR># Create a service for a replicated nginx using replica set, which serves on port 80 and connects to the containers on port 8000<BR>kubectl expose rs nginx --port=80 --target-port=8000<BR><BR># Create a service for an nginx deployment, which serves on port 80 and connects to the containers on port 8000<BR>kubectl expose deployment nginx --port=80 --target-port=8000<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--cluster-ip='': ClusterIP to be assigned to the service. Leave empty to auto-allocate, or set to 'None' to create a headless service.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--external-ip='': Additional external IP address (not managed by Kubernetes) to accept for the service. If this IP is routed to a node, the service can be accessed by this IP in addition to its generated service IP.<BR>--field-manager='kubectl-expose': Name of the manager used to track field ownership.<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to expose a service<BR>--generator='service/v2': The name of the API generator to use. There are 2 generators: 'service/v1' and 'service/v2'. The only difference between them is that service port in v1 is named 'default', while it is left unnamed in v2. Default is 'service/v2'.<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>-l, --labels='': Labels to apply to the service created by this call.<BR>--load-balancer-ip='': IP to assign to the LoadBalancer. If empty, an ephemeral IP will be created and used (cloud-provider specific).<BR>--name='': The name for the newly created object.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--override-type='merge': The method used to override the generated object: json, merge, or strategic.<BR>--overrides='': An inline JSON override for the generated object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field.<BR>--port='': The port that the service should serve on. Copied from the resource being exposed, if unspecified<BR>--protocol='': The network protocol for the service to be created. Default is 'TCP'.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--selector='': A label selector to use for this service. Only equality-based selector requirements are supported. If empty (the default) infer the selector from the replication controller or replica set.)<BR>--session-affinity='': If non-empty, set the session affinity for the service to this; legal values: 'None', 'ClientIP'<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--target-port='': Name or number for the port on the container that the service should direct traffic to. Optional.<BR>--template='': 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].<BR>--type='': Type for this service: ClusterIP, NodePort, LoadBalancer, or ExternalName. Default is 'ClusterIP'.<BR><BR>Usage:<BR>kubectl expose (-f FILENAME | TYPE NAME) [--port=port] [--protocol=TCP|UDP|SCTP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">run <span class="tooltiptext">Create and run a particular image in a pod.<BR><BR>Examples:<BR># Start a nginx pod<BR>kubectl run nginx --image=nginx<BR><BR># Start a hazelcast pod and let the container expose port 5701<BR>kubectl run hazelcast --image=hazelcast/hazelcast --port=5701<BR><BR># Start a hazelcast pod and set environment variables "DNS_DOMAIN=cluster" and "POD_NAMESPACE=default" in the container<BR>kubectl run hazelcast --image=hazelcast/hazelcast --env="DNS_DOMAIN=cluster" --env="POD_NAMESPACE=default"<BR><BR># Start a hazelcast pod and set labels "app=hazelcast" and "env=prod" in the container<BR>kubectl run hazelcast --image=hazelcast/hazelcast --labels="app=hazelcast,env=prod"<BR><BR># Dry run; print the corresponding API objects without creating them<BR>kubectl run nginx --image=nginx --dry-run=client<BR><BR># Start a nginx pod, but overload the spec with a partial set of values parsed from JSON<BR>kubectl run nginx --image=nginx --overrides='{ "apiVersion": "v1", "spec": { ... } }'<BR><BR># Start a busybox pod and keep it in the foreground, don't restart it if it exits<BR>kubectl run -i -t busybox --image=busybox --restart=Never<BR><BR># Start the nginx pod using the default command, but use custom arguments (arg1 .. argN) for that command<BR>kubectl run nginx --image=nginx -- (arg1) (arg2) ... (argN)<BR><BR># Start the nginx pod using a different command and custom arguments<BR>kubectl run nginx --image=nginx --command -- (cmd) (arg1) ... (argN)<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--annotations=[]: Annotations to apply to the pod.<BR>--attach=false: If true, wait for the Pod to start running, and then attach to the Pod as if 'kubectl attach ...' were called. Default false, unless '-i/--stdin' is set, in which case the default is true. With '--restart=Never' the exit code of the container process is returned.<BR>--cascade='background': Must be "background", "orphan", or "foreground". Selects the deletion cascading strategy for the dependents (e.g. Pods created by a ReplicationController). Defaults to background.<BR>--command=false: If true and extra arguments are present, use them as the 'command' field in the container, rather than the 'args' field which is the default.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--env=[]: Environment variables to set in the container.<BR>--expose=false: If true, create a ClusterIP service associated with the pod. Requires `--port`.<BR>--field-manager='kubectl-run': Name of the manager used to track field ownership.<BR>-f, --filename=[]: to use to replace the resource.<BR>--force=false: If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation.<BR>--grace-period=-1: Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion).<BR>--image='': The image for the container to run.<BR>--image-pull-policy='': The image pull policy for the container. If left empty, this value will not be specified by the client and defaulted by the server.<BR>-k, --kustomize='': Process a kustomization directory. This flag can't be used together with -f or -R.<BR>-l, --labels='': Comma separated labels to apply to the pod. Will override previous values.<BR>--leave-stdin-open=false: If the pod is started in interactive mode or with stdin, leave stdin open after the first attach completes. By default, stdin will be closed after the first attach completes.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--override-type='merge': The method used to override the generated object: json, merge, or strategic.<BR>--overrides='': An inline JSON override for the generated object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field.<BR>--pod-running-timeout=1m0s: The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running<BR>--port='': The port that this container exposes.<BR>--privileged=false: If true, run the container in privileged mode.<BR>-q, --quiet=false: If true, suppress prompt messages.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--restart='Always': The restart policy for this Pod. Legal values [Always, OnFailure, Never].<BR>--rm=false: If true, delete the pod after it exits. Only valid when attaching to the container, e.g. with '--attach' or with '-i/--stdin'.<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>-i, --stdin=false: Keep stdin open on the container in the pod, even if nothing is attached.<BR>--template='': 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].<BR>--timeout=0s: The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object<BR>-t, --tty=false: Allocate a TTY for the container in the pod.<BR>--wait=false: If true, wait for resources to be gone before returning. This waits for finalizers.<BR><BR>Usage:<BR>kubectl run NAME --image=image [--env="key=value"] [--port=port] [--dry-run=server|client] [--overrides=inline-json] [--command] -- [COMMAND] [args...] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI>
<details closed>
<summary><div class="tooltip">set <span class="tooltiptext">Configure application resources.<BR><BR>These commands help you make changes to existing application resources.<BR><BR>Available Commands:<BR>env Update environment variables on a pod template<BR>image Update the image of a pod template<BR>resources Update resource requests/limits on objects with pod templates<BR>selector Set the selector on a resource<BR>serviceaccount Update the service account of a resource<BR>subject Update the user, group, or service account in a role binding or cluster role binding<BR><BR>Usage:<BR>kubectl set SUBCOMMAND [options]<BR><BR>Use "kubectl (command) --help" for more information about a given command.<BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div></summary>
<UL>
<LI> <div class="tooltip">env <span class="tooltiptext">Update environment variables on a pod template.<BR><BR>List environment variable definitions in one or more pods, pod templates. Add, update, or remove container environment variable definitions in one or more pod templates (within replication controllers or deployment configurations). View or modify the environment variable definitions on all containers in the specified pods or pod templates, or just those that match a wildcard.<BR><BR>If "--env -" is passed, environment variables can be read from STDIN using the standard env syntax.<BR><BR>Possible resources include (case insensitive):<BR><BR>pod (po), replicationcontroller (rc), deployment (deploy), daemonset (ds), statefulset (sts), cronjob (cj), replicaset (rs)<BR><BR>Examples:<BR># Update deployment 'registry' with a new environment variable<BR>kubectl set env deployment/registry STORAGE_DIR=/local<BR><BR># List the environment variables defined on a deployments 'sample-build'<BR>kubectl set env deployment/sample-build --list<BR><BR># List the environment variables defined on all pods<BR>kubectl set env pods --all --list<BR><BR># Output modified deployment in YAML, and does not alter the object on the server<BR>kubectl set env deployment/sample-build STORAGE_DIR=/data -o yaml<BR><BR># Update all containers in all replication controllers in the project to have ENV=prod<BR>kubectl set env rc --all ENV=prod<BR><BR># Import environment from a secret<BR>kubectl set env --from=secret/mysecret deployment/myapp<BR><BR># Import environment from a config map with a prefix<BR>kubectl set env --from=configmap/myconfigmap --prefix=MYSQL_ deployment/myapp<BR><BR># Import specific keys from a config map<BR>kubectl set env --keys=my-example-key --from=configmap/myconfigmap deployment/myapp<BR><BR># Remove the environment variable ENV from container 'c1' in all deployment configs<BR>kubectl set env deployments --all --containers="c1" ENV-<BR><BR># Remove the environment variable ENV from a deployment definition on disk and<BR># update the deployment config on the server<BR>kubectl set env -f deploy.json ENV-<BR><BR># Set some of the local shell environment into a deployment config on the server<BR>env | grep RAILS_ | kubectl set env -e - deployment/registry<BR><BR>Options:<BR>--all=false: If true, select all resources in the namespace of the specified resource types<BR>--allow-missing-template-keys=true: 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.<BR>-c, --containers='*': The names of containers in the selected pod templates to change - may use wildcards<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>-e, --env=[]: Specify a key-value pair for an environment variable to set into each container.<BR>--field-manager='kubectl-set': Name of the manager used to track field ownership.<BR>-f, --filename=[]: Filename, directory, or URL to files the resource to update the env<BR>--from='': The name of a resource from which to inject environment variables<BR>--keys=[]: Comma-separated list of keys to import from specified resource<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>--list=false: If true, display the environment and any changes in the standard format. this flag will removed when we have kubectl view env.<BR>--local=false: If true, set env will NOT contact api-server but run locally.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--overwrite=true: If true, allow environment to be overwritten, otherwise reject updates that overwrite existing environment.<BR>--prefix='': Prefix to append to variable names<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--resolve=false: If true, show secret or configmap references when listing variables<BR>-l, --selector='': Selector (label query) to filter on<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl set env RESOURCE/NAME KEY_1=VAL_1 ... KEY_N=VAL_N [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">image <span class="tooltiptext">Update existing container image(s) of resources.<BR><BR>Possible resources include (case insensitive):<BR><BR>pod (po), replicationcontroller (rc), deployment (deploy), daemonset (ds), statefulset (sts), cronjob (cj), replicaset (rs)<BR><BR>Examples:<BR># Set a deployment's nginx container image to 'nginx:1.9.1', and its busybox container image to 'busybox'<BR>kubectl set image deployment/nginx busybox=busybox nginx=nginx:1.9.1<BR><BR># Update all deployments' and rc's nginx container's image to 'nginx:1.9.1'<BR>kubectl set image deployments,rc nginx=nginx:1.9.1 --all<BR><BR># Update image of all containers of daemonset abc to 'nginx:1.9.1'<BR>kubectl set image daemonset abc *=nginx:1.9.1<BR><BR># Print result (in yaml format) of updating nginx container image from local file, without hitting the server<BR>kubectl set image -f path/to/file.yaml nginx=nginx:1.9.1 --local -o yaml<BR><BR>Options:<BR>--all=false: Select all resources, in the namespace of the specified resource types<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-set': Name of the manager used to track field ownership.<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to get from a server.<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>--local=false: If true, set image will NOT contact api-server but run locally.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl set image (-f FILENAME | TYPE NAME) CONTAINER_NAME_1=CONTAINER_IMAGE_1 ... CONTAINER_NAME_N=CONTAINER_IMAGE_N [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">resources <span class="tooltiptext">Specify compute resource requirements (CPU, memory) for any resource that defines a pod template. If a pod is successfully scheduled, it is guaranteed the amount of resource requested, but may burst up to its specified limits.<BR><BR>For each compute resource, if a limit is specified and a request is omitted, the request will default to the limit.<BR><BR>Possible resources include (case insensitive): Use "kubectl api-resources" for a complete list of supported resources..<BR><BR>Examples:<BR># Set a deployments nginx container cpu limits to "200m" and memory to "512Mi"<BR>kubectl set resources deployment nginx -c=nginx --limits=cpu=200m,memory=512Mi<BR><BR># Set the resource request and limits for all containers in nginx<BR>kubectl set resources deployment nginx --limits=cpu=200m,memory=512Mi --requests=cpu=100m,memory=256Mi<BR><BR># Remove the resource requests for resources on containers in nginx<BR>kubectl set resources deployment nginx --limits=cpu=0,memory=0 --requests=cpu=0,memory=0<BR><BR># Print the result (in yaml format) of updating nginx container limits from a local, without hitting the server<BR>kubectl set resources -f path/to/file.yaml --limits=cpu=200m,memory=512Mi --local -o yaml<BR><BR>Options:<BR>--all=false: Select all resources, in the namespace of the specified resource types<BR>--allow-missing-template-keys=true: 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.<BR>-c, --containers='*': The names of containers in the selected pod templates to change, all containers are selected by default - may use wildcards<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-set': Name of the manager used to track field ownership.<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to get from a server.<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>--limits='': The resource requirement requests for this container. For example, 'cpu=100m,memory=256Mi'. Note that server side components may assign requests depending on the server configuration, such as limit ranges.<BR>--local=false: If true, set resources will NOT contact api-server but run locally.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--requests='': The resource requirement requests for this container. For example, 'cpu=100m,memory=256Mi'. Note that server side components may assign requests depending on the server configuration, such as limit ranges.<BR>-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl set resources (-f FILENAME | TYPE NAME) ([--limits=LIMITS & --requests=REQUESTS] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">selector <span class="tooltiptext">Set the selector on a resource. Note that the new selector will overwrite the old selector if the resource had one prior to the invocation of 'set selector'.<BR><BR>A selector must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to 63 characters. If --resource-version is specified, then updates will use this resource version, otherwise the existing resource-version will be used. Note: currently selectors can only be set on Service objects.<BR><BR>Examples:<BR># Set the labels and selector before creating a deployment/service pair<BR>kubectl create service clusterip my-svc --clusterip="None" -o yaml --dry-run=client | kubectl set selector --local -f - 'environment=qa' -o yaml | kubectl create -f -<BR>kubectl create deployment my-dep -o yaml --dry-run=client | kubectl label --local -f - environment=qa -o yaml | kubectl create -f -<BR><BR>Options:<BR>--all=false: Select all resources in the namespace of the specified resource types<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-set': Name of the manager used to track field ownership.<BR>-f, --filename=[]: identifying the resource.<BR>--local=false: If true, annotation will NOT contact api-server but run locally.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>-R, --recursive=true: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--resource-version='': If non-empty, the selectors update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl set selector (-f FILENAME | TYPE NAME) EXPRESSIONS [--resource-version=version] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">serviceaccount <span class="tooltiptext">Update the service account of pod template resources.<BR><BR>Possible resources (case insensitive) can be:<BR><BR>replicationcontroller (rc), deployment (deploy), daemonset (ds), job, replicaset (rs), statefulset<BR><BR>Aliases:<BR>serviceaccount, sa<BR><BR>Examples:<BR># Set deployment nginx-deployment's service account to serviceaccount1<BR>kubectl set serviceaccount deployment nginx-deployment serviceaccount1<BR><BR># Print the result (in YAML format) of updated nginx deployment with the service account from local file, without hitting the API server<BR>kubectl set sa -f nginx-deployment.yaml serviceaccount1 --local --dry-run=client -o yaml<BR><BR>Options:<BR>--all=false: Select all resources, in the namespace of the specified resource types<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-set': Name of the manager used to track field ownership.<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to get from a server.<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>--local=false: If true, set serviceaccount will NOT contact api-server but run locally.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl set serviceaccount (-f FILENAME | TYPE NAME) SERVICE_ACCOUNT [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">subject <span class="tooltiptext">Update the user, group, or service account in a role binding or cluster role binding.<BR><BR>Examples:<BR># Update a cluster role binding for serviceaccount1<BR>kubectl set subject clusterrolebinding admin --serviceaccount=namespace:serviceaccount1<BR><BR># Update a role binding for user1, user2, and group1<BR>kubectl set subject rolebinding admin --user=user1 --user=user2 --group=group1<BR><BR># Print the result (in YAML format) of updating rolebinding subjects from a local, without hitting the server<BR>kubectl create rolebinding admin --role=admin --user=admin -o yaml --dry-run=client | kubectl set subject --local -f - --user=foo -o yaml<BR><BR>Options:<BR>--all=false: Select all resources, in the namespace of the specified resource types<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-set': Name of the manager used to track field ownership.<BR>-f, --filename=[]: Filename, directory, or URL to files the resource to update the subjects<BR>--group=[]: Groups to bind to the role<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>--local=false: If true, set subject will NOT contact api-server but run locally.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)<BR>--serviceaccount=[]: Service accounts to bind to the role<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl set subject (-f FILENAME | TYPE NAME) [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run=server|client|none] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
</UL>
</details>
</LI>
</UL>
<H2>Basic Commands (Intermediate)</H2>
<UL class="tree-padding tree-vertical-lines tree-horizontal-lines tree-summaries tree-markers tree-buttons">
<LI> <div class="tooltip">explain <span class="tooltiptext">List the fields for supported resources.<BR><BR>This command describes the fields associated with each supported API resource. Fields are identified via a simple JSONPath identifier:<BR><BR>(type).(fieldName)[.(fieldName)]<BR><BR>Add the --recursive flag to display all of the fields at once without descriptions. Information about each field is retrieved from the server in OpenAPI format.<BR><BR>Use "kubectl api-resources" for a complete list of supported resources.<BR><BR>Examples:<BR># Get the documentation of the resource and its fields<BR>kubectl explain pods<BR><BR># Get the documentation of a specific field of a resource<BR>kubectl explain pods.spec.containers<BR><BR>Options:<BR>--api-version='': Get different explanations for particular API version (API group/version)<BR>--recursive=false: Print the fields of fields (Currently only 1 level deep)<BR><BR>Usage:<BR>kubectl explain RESOURCE [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">get <span class="tooltiptext">Display one or many resources.<BR><BR>Prints a table of the most important information about the specified resources. You can filter the list using a label selector and the --selector flag. If the desired resource type is namespaced you will only see results in your current namespace unless you pass --all-namespaces.<BR><BR>By specifying the output as 'template' and providing a Go template as the value of the --template flag, you can filter the attributes of the fetched resources.<BR><BR>Use "kubectl api-resources" for a complete list of supported resources.<BR><BR>Examples:<BR># List all pods in ps output format<BR>kubectl get pods<BR><BR># List all pods in ps output format with more information (such as node name)<BR>kubectl get pods -o wide<BR><BR># List a single replication controller with specified NAME in ps output format<BR>kubectl get replicationcontroller web<BR><BR># List deployments in JSON output format, in the "v1" version of the "apps" API group<BR>kubectl get deployments.v1.apps -o json<BR><BR># List a single pod in JSON output format<BR>kubectl get -o json pod web-pod-13je7<BR><BR># List a pod identified by type and name specified in "pod.yaml" in JSON output format<BR>kubectl get -f pod.yaml -o json<BR><BR># List resources from a directory with kustomization.yaml - e.g. dir/kustomization.yaml<BR>kubectl get -k dir/<BR><BR># Return only the phase value of the specified pod<BR>kubectl get -o template pod/web-pod-13je7 --template={{.status.phase}}<BR><BR># List resource information in custom columns<BR>kubectl get pod test-pod -o custom-columns=CONTAINER:.spec.containers[0].name,IMAGE:.spec.containers[0].image<BR><BR># List all replication controllers and services together in ps output format<BR>kubectl get rc,services<BR><BR># List one or more resources by their type and names<BR>kubectl get rc/web service/frontend pods/web-pod-13je7<BR><BR>Options:<BR>-A, --all-namespaces=false: If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.<BR>--allow-missing-template-keys=true: 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.<BR>--chunk-size=500: Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.<BR>--field-selector='': Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to get from a server.<BR>--ignore-not-found=false: If the requested object does not exist the command will return exit code 0.<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>-L, --label-columns=[]: Accepts a comma separated list of labels that are going to be presented as columns. Names are case-sensitive. You can also use multiple flag options like -L label1 -L label2...<BR>--no-headers=false: When using the default or custom-column output format, don't print headers (default print headers).<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file|custom-columns-file|custom-columns|wide See custom columns [https://kubernetes.io/docs/reference/kubectl/overview/#custom-columns], golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [https://kubernetes.io/docs/reference/kubectl/jsonpath/].<BR>--output-watch-events=false: Output watch event objects when --watch or --watch-only is used. Existing objects are output as initial ADDED events.<BR>--raw='': Raw URI to request from the server. Uses the transport specified by the kubeconfig file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)<BR>--server-print=true: If true, have the server return the appropriate table output. Supports extension APIs and CRDs.<BR>--show-kind=false: If present, list the resource type for the requested object(s).<BR>--show-labels=false: When printing, show all labels as the last column (default hide labels column)<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--sort-by='': 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.<BR>--template='': 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].<BR>-w, --watch=false: After listing/getting the requested object, watch for changes.<BR>--watch-only=false: Watch for changes to the requested object(s), without listing/getting first.<BR><BR>Usage:<BR>kubectl get [(-o|--output=)json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file|custom-columns-file|custom-columns|wide] (TYPE[.VERSION][.GROUP] [NAME | -l label] | TYPE[.VERSION][.GROUP]/NAME ...) [flags] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">edit <span class="tooltiptext">Edit a resource from the default editor.<BR><BR>The edit 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 file names as well as command-line arguments, although the files you point to must be previously saved versions of resources.<BR><BR>Editing is done with the API version used to fetch the resource. To edit using a specific API version, fully-qualify the resource, version, and group.<BR><BR>The default format is YAML. To edit in JSON, specify "-o json".<BR><BR>The flag --windows-line-endings can be used to force Windows line endings, otherwise the default for your operating system will be used.<BR><BR>In 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.<BR><BR>Examples:<BR># Edit the service named 'docker-registry'<BR>kubectl edit svc/docker-registry<BR><BR># Use an alternative editor<BR>KUBE_EDITOR="nano" kubectl edit svc/docker-registry<BR><BR># Edit the job 'myjob' in JSON using the v1 API format<BR>kubectl edit job.v1.batch/myjob -o json<BR><BR># Edit the deployment 'mydeployment' in YAML and save the modified config in its annotation<BR>kubectl edit deployment/mydeployment -o yaml --save-config<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--field-manager='kubectl-edit': Name of the manager used to track field ownership.<BR>-f, --filename=[]: Filename, directory, or URL to files to use to edit the resource<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--output-patch=false: Output the patch if the resource is edited.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--validate=true: If true, use a schema to validate the input before sending it<BR>--windows-line-endings=false: Defaults to the line ending native to your platform.<BR><BR>Usage:<BR>kubectl edit (RESOURCE/NAME | -f FILENAME) [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">delete <span class="tooltiptext">Delete resources by file names, stdin, resources and names, or by resources and label selector.<BR><BR>JSON and YAML formats are accepted. Only one type of argument may be specified: file names, resources and names, or resources and label selector.<BR><BR>Some resources, such as pods, support graceful deletion. These resources define a default period before they are forcibly terminated (the grace period) but you may override that value with the --grace-period flag, or pass --now to set a grace-period of 1. Because these resources often represent entities in the cluster, deletion may not be acknowledged immediately. If the node hosting a pod is down or cannot reach the API server, termination may take significantly longer than the grace period. To force delete a resource, you must specify the --force flag. Note: only a subset of resources support graceful deletion. In absence of the support, the --grace-period flag is ignored.<BR><BR>IMPORTANT: Force deleting pods does not wait for confirmation that the pod's processes have been terminated, which can leave those processes running until the node detects the deletion and completes graceful deletion. If your processes use shared storage or talk to a remote API and depend on the name of the pod to identify themselves, force deleting those pods may result in multiple processes running on different machines using the same identification which may lead to data corruption or inconsistency. Only force delete pods when you are sure the pod is terminated, or if your application can tolerate multiple copies of the same pod running at once. Also, if you force delete pods, the scheduler may place new pods on those nodes before the node has released those resources and causing those pods to be evicted immediately.<BR><BR>Note that the delete command does NOT do resource version checks, so if someone submits an update to a resource right when you submit a delete, their update will be lost along with the rest of the resource.<BR><BR>Examples:<BR># Delete a pod using the type and name specified in pod.json<BR>kubectl delete -f ./pod.json<BR><BR># Delete resources from a directory containing kustomization.yaml - e.g. dir/kustomization.yaml<BR>kubectl delete -k dir<BR><BR># Delete a pod based on the type and name in the JSON passed into stdin<BR>cat pod.json | kubectl delete -f -<BR><BR># Delete pods and services with same names "baz" and "foo"<BR>kubectl delete pod,service baz foo<BR><BR># Delete pods and services with label name=myLabel<BR>kubectl delete pods,services -l name=myLabel<BR><BR># Delete a pod with minimal delay<BR>kubectl delete pod foo --now<BR><BR># Force delete a pod on a dead node<BR>kubectl delete pod foo --force<BR><BR># Delete all pods<BR>kubectl delete pods --all<BR><BR>Options:<BR>--all=false: Delete all resources, in the namespace of the specified resource types.<BR>-A, --all-namespaces=false: If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.<BR>--cascade='background': Must be "background", "orphan", or "foreground". Selects the deletion cascading strategy for the dependents (e.g. Pods created by a ReplicationController). Defaults to background.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-selector='': Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.<BR>-f, --filename=[]: containing the resource to delete.<BR>--force=false: If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation.<BR>--grace-period=-1: Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion).<BR>--ignore-not-found=false: Treat "resource not found" as a successful delete. Defaults to "true" when --all is specified.<BR>-k, --kustomize='': Process a kustomization directory. This flag can't be used together with -f or -R.<BR>--now=false: If true, resources are signaled for immediate shutdown (same as --grace-period=1).<BR>-o, --output='': Output mode. Use "-o name" for shorter output (resource/name).<BR>--raw='': Raw URI to DELETE to the server. Uses the transport specified by the kubeconfig file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>-l, --selector='': Selector (label query) to filter on.<BR>--timeout=0s: The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object<BR>--wait=true: If true, wait for resources to be gone before returning. This waits for finalizers.<BR><BR>Usage:<BR>kubectl delete ([-f FILENAME] | [-k DIRECTORY] | TYPE [(NAME | -l label | --all)]) [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
</UL>
<H2>Deploy Command</H2>
<UL class="tree-padding tree-vertical-lines tree-horizontal-lines tree-summaries tree-markers tree-buttons">
<LI>
<details closed>
<summary><div class="tooltip">rollout <span class="tooltiptext">Manage the rollout of a resource.<BR><BR>Valid resource types include:<BR><BR>* deployments<BR>* daemonsets<BR>* statefulsets<BR><BR>Examples:<BR># Rollback to the previous deployment<BR>kubectl rollout undo deployment/abc<BR><BR># Check the rollout status of a daemonset<BR>kubectl rollout status daemonset/foo<BR><BR>Available Commands:<BR>history View rollout history<BR>pause Mark the provided resource as paused<BR>restart Restart a resource<BR>resume Resume a paused resource<BR>status Show the status of the rollout<BR>undo Undo a previous rollout<BR><BR>Usage:<BR>kubectl rollout SUBCOMMAND [options]<BR><BR>Use "kubectl (command) --help" for more information about a given command.<BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div></summary>
<UL>
<LI> <div class="tooltip">history <span class="tooltiptext">View previous rollout revisions and configurations.<BR><BR>Examples:<BR># View the rollout history of a deployment<BR>kubectl rollout history deployment/abc<BR><BR># View the details of daemonset revision 3<BR>kubectl rollout history daemonset/abc --revision=3<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to get from a server.<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--revision=0: See the details, including podTemplate of the revision specified<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl rollout history (TYPE NAME | TYPE/NAME) [flags] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">pause <span class="tooltiptext">Mark the provided resource as paused.<BR><BR>Paused resources will not be reconciled by a controller. Use "kubectl rollout resume" to resume a paused resource. Currently only deployments support being paused.<BR><BR>Examples:<BR># Mark the nginx deployment as paused<BR># Any current state of the deployment will continue its function; new updates<BR># to the deployment will not have an effect as long as the deployment is paused<BR>kubectl rollout pause deployment/nginx<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--field-manager='kubectl-rollout': Name of the manager used to track field ownership.<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to get from a server.<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl rollout pause RESOURCE [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">restart <span class="tooltiptext">Restart a resource.<BR><BR>Resource rollout will be restarted.<BR><BR>Examples:<BR># Restart a deployment<BR>kubectl rollout restart deployment/nginx<BR><BR># Restart a daemon set<BR>kubectl rollout restart daemonset/abc<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--field-manager='kubectl-rollout': Name of the manager used to track field ownership.<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to get from a server.<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl rollout restart RESOURCE [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">resume <span class="tooltiptext">Resume a paused resource.<BR><BR>Paused resources will not be reconciled by a controller. By resuming a resource, we allow it to be reconciled again. Currently only deployments support being resumed.<BR><BR>Examples:<BR># Resume an already paused deployment<BR>kubectl rollout resume deployment/nginx<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--field-manager='kubectl-rollout': Name of the manager used to track field ownership.<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to get from a server.<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl rollout resume RESOURCE [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">status <span class="tooltiptext">Show the status of the rollout.<BR><BR>By default 'rollout status' will watch the status of the latest rollout until it's done. If you don't want to wait for the rollout to finish then you can use --watch=false. Note that if a new rollout starts in-between, then 'rollout status' will continue watching the latest revision. If you want to pin to a specific revision and abort if it is rolled over by another revision, use --revision=N where N is the revision you need to watch for.<BR><BR>Examples:<BR># Watch the rollout status of a deployment<BR>kubectl rollout status deployment/nginx<BR><BR>Options:<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to get from a server.<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--revision=0: Pin to a specific revision for showing its status. Defaults to 0 (last revision).<BR>--timeout=0s: The length of time to wait before ending watch, zero means never. Any other values should contain a corresponding time unit (e.g. 1s, 2m, 3h).<BR>-w, --watch=true: Watch the status of the rollout until it's done.<BR><BR>Usage:<BR>kubectl rollout status (TYPE NAME | TYPE/NAME) [flags] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">undo <span class="tooltiptext">Roll back to a previous rollout.<BR><BR>Examples:<BR># Roll back to the previous deployment<BR>kubectl rollout undo deployment/abc<BR><BR># Roll back to daemonset revision 3<BR>kubectl rollout undo daemonset/abc --to-revision=3<BR><BR># Roll back to the previous deployment with dry-run<BR>kubectl rollout undo --dry-run=server deployment/abc<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to get from a server.<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--to-revision=0: The revision to rollback to. Default to 0 (last revision).<BR><BR>Usage:<BR>kubectl rollout undo (TYPE NAME | TYPE/NAME) [flags] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
</UL>
</details>
</LI>
<LI> <div class="tooltip">scale <span class="tooltiptext">Set a new size for a deployment, replica set, replication controller, or stateful set.<BR><BR>Scale also allows users to specify one or more preconditions for the scale action.<BR><BR>If --current-replicas or --resource-version is specified, it is validated before the scale is attempted, and it is guaranteed that the precondition holds true when the scale is sent to the server.<BR><BR>Examples:<BR># Scale a replica set named 'foo' to 3<BR>kubectl scale --replicas=3 rs/foo<BR><BR># Scale a resource identified by type and name specified in "foo.yaml" to 3<BR>kubectl scale --replicas=3 -f foo.yaml<BR><BR># If the deployment named mysql's current size is 2, scale mysql to 3<BR>kubectl scale --current-replicas=2 --replicas=3 deployment/mysql<BR><BR># Scale multiple replication controllers<BR>kubectl scale --replicas=5 rc/foo rc/bar rc/baz<BR><BR># Scale stateful set named 'web' to 3<BR>kubectl scale --replicas=3 statefulset/web<BR><BR>Options:<BR>--all=false: Select all resources in the namespace of the specified resource types<BR>--allow-missing-template-keys=true: 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.<BR>--current-replicas=-1: Precondition for current size. Requires that the current size of the resource match this value in order to scale. -1 (default) for no condition.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to set a new size<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--replicas=0: The new desired number of replicas. Required.<BR>--resource-version='': Precondition for resource version. Requires that the current resource version match this value in order to scale.<BR>-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--timeout=0s: The length of time to wait before giving up on a scale operation, zero means don't wait. Any other values should contain a corresponding time unit (e.g. 1s, 2m, 3h).<BR><BR>Usage:<BR>kubectl scale [--resource-version=version] [--current-replicas=count] --replicas=COUNT (-f FILENAME | TYPE NAME) [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">autoscale <span class="tooltiptext">Creates an autoscaler that automatically chooses and sets the number of pods that run in a Kubernetes cluster.<BR><BR>Looks up a deployment, replica set, stateful set, or replication controller by name and creates an autoscaler that uses the given resource as a reference. An autoscaler can automatically increase or decrease number of pods deployed within the system as needed.<BR><BR>Examples:<BR># Auto scale a deployment "foo", with the number of pods between 2 and 10, no target CPU utilization specified so a default autoscaling policy will be used<BR>kubectl autoscale deployment foo --min=2 --max=10<BR><BR># Auto scale a replication controller "foo", with the number of pods between 1 and 5, target CPU utilization at 80%<BR>kubectl autoscale rc foo --max=5 --cpu-percent=80<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--cpu-percent=-1: The target average CPU utilization (represented as a percent of requested CPU) over all the pods. If it's not specified or negative, a default autoscaling policy will be used.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-autoscale': Name of the manager used to track field ownership.<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to autoscale.<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>--max=-1: The upper limit for the number of pods that can be set by the autoscaler. Required.<BR>--min=-1: The lower limit for the number of pods that can be set by the autoscaler. If it's not specified or negative, the server will apply a default value.<BR>--name='': The name for the newly created object. If not specified, the name of the input resource will be used.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl autoscale (-f FILENAME | TYPE NAME | TYPE/NAME) [--min=MINPODS] --max=MAXPODS [--cpu-percent=CPU] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
</UL>
<H2>Cluster Management Commands</H2>
<UL class="tree-padding tree-vertical-lines tree-horizontal-lines tree-summaries tree-markers tree-buttons">
<LI>
<details closed>
<summary><div class="tooltip">certificate <span class="tooltiptext">Modify certificate resources.<BR><BR>Available Commands:<BR>approve Approve a certificate signing request<BR>deny Deny a certificate signing request<BR><BR>Usage:<BR>kubectl certificate SUBCOMMAND [options]<BR><BR>Use "kubectl (command) --help" for more information about a given command.<BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div></summary>
<UL>
<LI> <div class="tooltip">approve <span class="tooltiptext">Approve a certificate signing request.<BR><BR>kubectl certificate approve allows a cluster admin to approve a certificate signing request (CSR). This action tells a certificate signing controller to issue a certificate to the requestor with the attributes requested in the CSR.<BR><BR>SECURITY NOTICE: Depending on the requested attributes, the issued certificate can potentially grant a requester access to cluster resources or to authenticate as a requested identity. Before approving a CSR, ensure you understand what the signed certificate can do.<BR><BR>Examples:<BR># Approve CSR 'csr-sqgzp'<BR>kubectl certificate approve csr-sqgzp<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to update<BR>--force=false: Update the CSR even if it is already approved.<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl certificate approve (-f FILENAME | NAME) [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">deny <span class="tooltiptext">Deny a certificate signing request.<BR><BR>kubectl certificate deny allows a cluster admin to deny a certificate signing request (CSR). This action tells a certificate signing controller to not to issue a certificate to the requestor.<BR><BR>Examples:<BR># Deny CSR 'csr-sqgzp'<BR>kubectl certificate deny csr-sqgzp<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to update<BR>--force=false: Update the CSR even if it is already denied.<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl certificate deny (-f FILENAME | NAME) [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
</UL>
</details>
</LI>
<LI>
<details closed>
<summary><div class="tooltip">cluster-info <span class="tooltiptext">Display addresses of the control plane and services with label kubernetes.io/cluster-service=true. To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.<BR><BR>Examples:<BR># Print the address of the control plane and cluster services<BR>kubectl cluster-info<BR><BR>Available Commands:<BR>dump Dump relevant information for debugging and diagnosis<BR><BR>Usage:<BR>kubectl cluster-info [flags] [options]<BR><BR>Use "kubectl (command) --help" for more information about a given command.<BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div></summary>
<UL>
<LI> <div class="tooltip">dump <span class="tooltiptext">Dump cluster information out suitable for debugging and diagnosing cluster problems. By default, dumps everything to stdout. You can optionally specify a directory with --output-directory. If you specify a directory, Kubernetes will build a set of files in that directory. By default, only dumps things in the current namespace and 'kube-system' namespace, but you can switch to a different namespace with the --namespaces flag, or specify --all-namespaces to dump all namespaces.<BR><BR>The command also dumps the logs of all of the pods in the cluster; these logs are dumped into different directories based on namespace and pod name.<BR><BR>Examples:<BR># Dump current cluster state to stdout<BR>kubectl cluster-info dump<BR><BR># Dump current cluster state to /path/to/cluster-state<BR>kubectl cluster-info dump --output-directory=/path/to/cluster-state<BR><BR># Dump all namespaces to stdout<BR>kubectl cluster-info dump --all-namespaces<BR><BR># Dump a set of namespaces to /path/to/cluster-state<BR>kubectl cluster-info dump --namespaces default,kube-system --output-directory=/path/to/cluster-state<BR><BR>Options:<BR>-A, --all-namespaces=false: If true, dump all namespaces. If true, --namespaces is ignored.<BR>--allow-missing-template-keys=true: 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.<BR>--namespaces=[]: A comma separated list of namespaces to dump.<BR>-o, --output='json': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--output-directory='': Where to output the files. If empty or '-' uses stdout, otherwise creates a directory hierarchy in that directory<BR>--pod-running-timeout=20s: The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl cluster-info dump [flags] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
</UL>
</details>
</LI>
<LI>
<details closed>
<summary><div class="tooltip">top <span class="tooltiptext">Display Resource (CPU/Memory) usage.<BR><BR>The top command allows you to see the resource consumption for nodes or pods.<BR><BR>This command requires Metrics Server to be correctly configured and working on the server.<BR><BR>Available Commands:<BR>node Display resource (CPU/memory) usage of nodes<BR>pod Display resource (CPU/memory) usage of pods<BR><BR>Usage:<BR>kubectl top [flags] [options]<BR><BR>Use "kubectl (command) --help" for more information about a given command.<BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div></summary>
<UL>
<LI> <div class="tooltip">node <span class="tooltiptext">Display resource (CPU/memory) usage of nodes.<BR><BR>The top-node command allows you to see the resource consumption of nodes.<BR><BR>Aliases:<BR>node, nodes, no<BR><BR>Examples:<BR># Show metrics for all nodes<BR>kubectl top node<BR><BR># Show metrics for a given node<BR>kubectl top node NODE_NAME<BR><BR>Options:<BR>--no-headers=false: If present, print output without headers<BR>-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)<BR>--show-capacity=false: Print node resources based on Capacity instead of Allocatable(default) of the nodes.<BR>--sort-by='': If non-empty, sort nodes list using specified field. The field can be either 'cpu' or 'memory'.<BR>--use-protocol-buffers=true: Enables using protocol-buffers to access Metrics API.<BR><BR>Usage:<BR>kubectl top node [NAME | -l label] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">pod <span class="tooltiptext">Display resource (CPU/memory) usage of pods.<BR><BR>The 'top pod' command allows you to see the resource consumption of pods.<BR><BR>Due to the metrics pipeline delay, they may be unavailable for a few minutes since pod creation.<BR><BR>Aliases:<BR>pod, pods, po<BR><BR>Examples:<BR># Show metrics for all pods in the default namespace<BR>kubectl top pod<BR><BR># Show metrics for all pods in the given namespace<BR>kubectl top pod --namespace=NAMESPACE<BR><BR># Show metrics for a given pod and its containers<BR>kubectl top pod POD_NAME --containers<BR><BR># Show metrics for the pods defined by label name=myLabel<BR>kubectl top pod -l name=myLabel<BR><BR>Options:<BR>-A, --all-namespaces=false: If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.<BR>--containers=false: If present, print usage of containers within a pod.<BR>--field-selector='': Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.<BR>--no-headers=false: If present, print output without headers.<BR>-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)<BR>--sort-by='': If non-empty, sort pods list using specified field. The field can be either 'cpu' or 'memory'.<BR>--use-protocol-buffers=true: Enables using protocol-buffers to access Metrics API.<BR><BR>Usage:<BR>kubectl top pod [NAME | -l label] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
</UL>
</details>
</LI>
<LI> <div class="tooltip">cordon <span class="tooltiptext">Mark node as unschedulable.<BR><BR>Examples:<BR># Mark node "foo" as unschedulable<BR>kubectl cordon foo<BR><BR>Options:<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>-l, --selector='': Selector (label query) to filter on<BR><BR>Usage:<BR>kubectl cordon NODE [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">uncordon <span class="tooltiptext">Mark node as schedulable.<BR><BR>Examples:<BR># Mark node "foo" as schedulable<BR>kubectl uncordon foo<BR><BR>Options:<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>-l, --selector='': Selector (label query) to filter on<BR><BR>Usage:<BR>kubectl uncordon NODE [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">drain <span class="tooltiptext">Drain node in preparation for maintenance.<BR><BR>The given node will be marked unschedulable to prevent new pods from arriving. 'drain' evicts the pods if the API server supports https://kubernetes.io/docs/concepts/workloads/pods/disruptions/ . Otherwise, it will use normal DELETE to delete the pods. The 'drain' evicts or deletes all pods except mirror pods (which cannot be deleted through the API server). If there are daemon set-managed pods, drain will not proceed without --ignore-daemonsets, and regardless it will not delete any daemon set-managed pods, because those pods would be immediately replaced by the daemon set controller, which ignores unschedulable markings. If there are any pods that are neither mirror pods nor managed by a replication controller, replica set, daemon set, stateful set, or job, then drain will not delete any pods unless you use --force. --force will also allow deletion to proceed if the managing resource of one or more pods is missing.<BR><BR>'drain' waits for graceful termination. You should not operate on the machine until the command completes.<BR><BR>When you are ready to put the node back into service, use kubectl uncordon, which will make the node schedulable again.<BR><BR>https://kubernetes.io/images/docs/kubectl_drain.svg<BR><BR>Examples:<BR># Drain node "foo", even if there are pods not managed by a replication controller, replica set, job, daemon set or stateful set on it<BR>kubectl drain foo --force<BR><BR># As above, but abort if there are pods not managed by a replication controller, replica set, job, daemon set or stateful set, and use a grace period of 15 minutes<BR>kubectl drain foo --grace-period=900<BR><BR>Options:<BR>--chunk-size=500: Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.<BR>--delete-emptydir-data=false: Continue even if there are pods using emptyDir (local data that will be deleted when the node is drained).<BR>--disable-eviction=false: Force drain to use delete, even if eviction is supported. This will bypass checking PodDisruptionBudgets, use with caution.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--force=false: Continue even if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet.<BR>--grace-period=-1: Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used.<BR>--ignore-daemonsets=false: Ignore DaemonSet-managed pods.<BR>--pod-selector='': Label selector to filter pods on the node<BR>-l, --selector='': Selector (label query) to filter on<BR>--skip-wait-for-delete-timeout=0: If pod DeletionTimestamp older than N seconds, skip waiting for the pod. Seconds must be greater than 0 to skip.<BR>--timeout=0s: The length of time to wait before giving up, zero means infinite<BR><BR>Usage:<BR>kubectl drain NODE [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">taint <span class="tooltiptext">Update the taints on one or more nodes.<BR><BR>* A taint consists of a key, value, and effect. As an argument here, it is expressed as key=value:effect.<BR>* The key must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to 253 characters.<BR>* Optionally, the key can begin with a DNS subdomain prefix and a single '/', like example.com/my-app.<BR>* The value is optional. If given, it must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to 63 characters.<BR>* The effect must be NoSchedule, PreferNoSchedule or NoExecute.<BR>* Currently taint can only apply to node.<BR><BR>Examples:<BR># Update node 'foo' with a taint with key 'dedicated' and value 'special-user' and effect 'NoSchedule'<BR># If a taint with that key and effect already exists, its value is replaced as specified<BR>kubectl taint nodes foo dedicated=special-user:NoSchedule<BR><BR># Remove from node 'foo' the taint with key 'dedicated' and effect 'NoSchedule' if one exists<BR>kubectl taint nodes foo dedicated:NoSchedule-<BR><BR># Remove from node 'foo' all the taints with key 'dedicated'<BR>kubectl taint nodes foo dedicated-<BR><BR># Add a taint with key 'dedicated' on nodes having label mylabel=X<BR>kubectl taint node -l myLabel=X dedicated=foo:PreferNoSchedule<BR><BR># Add to node 'foo' a taint with key 'bar' and no value<BR>kubectl taint nodes foo bar:NoSchedule<BR><BR>Options:<BR>--all=false: Select all nodes in the cluster<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-taint': Name of the manager used to track field ownership.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--overwrite=false: If true, allow taints to be overwritten, otherwise reject taint updates that overwrite existing taints.<BR>-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--validate=true: If true, use a schema to validate the input before sending it<BR><BR>Usage:<BR>kubectl taint NODE NAME KEY_1=VAL_1:TAINT_EFFECT_1 ... KEY_N=VAL_N:TAINT_EFFECT_N [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
</UL>
<H2>Troubleshooting and Debugging Commands</H2>
<UL class="tree-padding tree-vertical-lines tree-horizontal-lines tree-summaries tree-markers tree-buttons">
<LI> <div class="tooltip">describe <span class="tooltiptext">Show details of a specific resource or group of resources.<BR><BR>Print a detailed description of the selected resources, including related resources such as events or controllers. You may select a single object by name, all objects of that type, provide a name prefix, or label selector. For example:<BR><BR>$ kubectl describe TYPE NAME_PREFIX<BR><BR>will first check for an exact match on TYPE and NAME_PREFIX. If no such resource exists, it will output details for every resource that has a name prefixed with NAME_PREFIX.<BR><BR>Use "kubectl api-resources" for a complete list of supported resources.<BR><BR>Examples:<BR># Describe a node<BR>kubectl describe nodes kubernetes-node-emt8.c.myproject.internal<BR><BR># Describe a pod<BR>kubectl describe pods/nginx<BR><BR># Describe a pod identified by type and name in "pod.json"<BR>kubectl describe -f pod.json<BR><BR># Describe all pods<BR>kubectl describe pods<BR><BR># Describe pods by label name=myLabel<BR>kubectl describe po -l name=myLabel<BR><BR># Describe all pods managed by the 'frontend' replication controller<BR># (rc-created pods get the name of the rc as a prefix in the pod name)<BR>kubectl describe pods frontend<BR><BR>Options:<BR>-A, --all-namespaces=false: If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.<BR>--chunk-size=500: Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.<BR>-f, --filename=[]: Filename, directory, or URL to files containing the resource to describe<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)<BR>--show-events=true: If true, display events related to the described object.<BR><BR>Usage:<BR>kubectl describe (-f FILENAME | TYPE [NAME_PREFIX | -l label] | TYPE/NAME) [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">logs <span class="tooltiptext">Print the logs for a container in a pod or specified resource. If the pod has only one container, the container name is optional.<BR><BR>Examples:<BR># Return snapshot logs from pod nginx with only one container<BR>kubectl logs nginx<BR><BR># Return snapshot logs from pod nginx with multi containers<BR>kubectl logs nginx --all-containers=true<BR><BR># Return snapshot logs from all containers in pods defined by label app=nginx<BR>kubectl logs -l app=nginx --all-containers=true<BR><BR># Return snapshot of previous terminated ruby container logs from pod web-1<BR>kubectl logs -p -c ruby web-1<BR><BR># Begin streaming the logs of the ruby container in pod web-1<BR>kubectl logs -f -c ruby web-1<BR><BR># Begin streaming the logs from all containers in pods defined by label app=nginx<BR>kubectl logs -f -l app=nginx --all-containers=true<BR><BR># Display only the most recent 20 lines of output in pod nginx<BR>kubectl logs --tail=20 nginx<BR><BR># Show all logs from pod nginx written in the last hour<BR>kubectl logs --since=1h nginx<BR><BR># Show logs from a kubelet with an expired serving certificate<BR>kubectl logs --insecure-skip-tls-verify-backend nginx<BR><BR># Return snapshot logs from first container of a job named hello<BR>kubectl logs job/hello<BR><BR># Return snapshot logs from container nginx-1 of a deployment named nginx<BR>kubectl logs deployment/nginx -c nginx-1<BR><BR>Options:<BR>--all-containers=false: Get all containers' logs in the pod(s).<BR>-c, --container='': Print the logs of this container<BR>-f, --follow=false: Specify if the logs should be streamed.<BR>--ignore-errors=false: If watching / following pod logs, allow for any errors that occur to be non-fatal<BR>--insecure-skip-tls-verify-backend=false: Skip verifying the identity of the kubelet that logs are requested from. In theory, an attacker could provide invalid log content back. You might want to use this if your kubelet serving certificates have expired.<BR>--limit-bytes=0: Maximum bytes of logs to return. Defaults to no limit.<BR>--max-log-requests=5: Specify maximum number of concurrent logs to follow when using by a selector. Defaults to 5.<BR>--pod-running-timeout=20s: The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running<BR>--prefix=false: Prefix each log line with the log source (pod name and container name)<BR>-p, --previous=false: If true, print the logs for the previous instance of the container in a pod if it exists.<BR>-l, --selector='': Selector (label query) to filter on.<BR>--since=0s: Only return logs newer than a relative duration like 5s, 2m, or 3h. Defaults to all logs. Only one of since-time / since may be used.<BR>--since-time='': Only return logs after a specific date (RFC3339). Defaults to all logs. Only one of since-time / since may be used.<BR>--tail=-1: Lines of recent log file to display. Defaults to -1 with no selector, showing all log lines otherwise 10, if a selector is provided.<BR>--timestamps=false: Include timestamps on each line in the log output<BR><BR>Usage:<BR>kubectl logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">attach <span class="tooltiptext">Attach to a process that is already running inside an existing container.<BR><BR>Examples:<BR># Get output from running pod mypod; use the 'kubectl.kubernetes.io/default-container' annotation<BR># for selecting the container to be attached or the first container in the pod will be chosen<BR>kubectl attach mypod<BR><BR># Get output from ruby-container from pod mypod<BR>kubectl attach mypod -c ruby-container<BR><BR># Switch to raw terminal mode; sends stdin to 'bash' in ruby-container from pod mypod<BR># and sends stdout/stderr from 'bash' back to the client<BR>kubectl attach mypod -c ruby-container -i -t<BR><BR># Get output from the first pod of a replica set named nginx<BR>kubectl attach rs/nginx<BR><BR>Options:<BR>-c, --container='': Container name. If omitted, use the kubectl.kubernetes.io/default-container annotation for selecting the container to be attached or the first container in the pod will be chosen<BR>--pod-running-timeout=1m0s: The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running<BR>-q, --quiet=false: Only print output from the remote session<BR>-i, --stdin=false: Pass stdin to the container<BR>-t, --tty=false: Stdin is a TTY<BR><BR>Usage:<BR>kubectl attach (POD | TYPE/NAME) -c CONTAINER [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">exec <span class="tooltiptext">Execute a command in a container.<BR><BR>Examples:<BR># Get output from running the 'date' command from pod mypod, using the first container by default<BR>kubectl exec mypod -- date<BR><BR># Get output from running the 'date' command in ruby-container from pod mypod<BR>kubectl exec mypod -c ruby-container -- date<BR><BR># Switch to raw terminal mode; sends stdin to 'bash' in ruby-container from pod mypod<BR># and sends stdout/stderr from 'bash' back to the client<BR>kubectl exec mypod -c ruby-container -i -t -- bash -il<BR><BR># List contents of /usr from the first container of pod mypod and sort by modification time<BR># If the command you want to execute in the pod has any flags in common (e.g. -i),<BR># you must use two dashes (--) to separate your command's flags/arguments<BR># Also note, do not surround your command and its flags/arguments with quotes<BR># unless that is how you would execute it normally (i.e., do ls -t /usr, not "ls -t /usr")<BR>kubectl exec mypod -i -t -- ls -t /usr<BR><BR># Get output from running 'date' command from the first pod of the deployment mydeployment, using the first container by default<BR>kubectl exec deploy/mydeployment -- date<BR><BR># Get output from running 'date' command from the first pod of the service myservice, using the first container by default<BR>kubectl exec svc/myservice -- date<BR><BR>Options:<BR>-c, --container='': Container name. If omitted, use the kubectl.kubernetes.io/default-container annotation for selecting the container to be attached or the first container in the pod will be chosen<BR>-f, --filename=[]: to use to exec into the resource<BR>--pod-running-timeout=1m0s: The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running<BR>-q, --quiet=false: Only print output from the remote session<BR>-i, --stdin=false: Pass stdin to the container<BR>-t, --tty=false: Stdin is a TTY<BR><BR>Usage:<BR>kubectl exec (POD | TYPE/NAME) [-c CONTAINER] [flags] -- COMMAND [args...] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">port-forward <span class="tooltiptext">Forward one or more local ports to a pod.<BR><BR>Use resource type/name such as deployment/mydeployment to select a pod. Resource type defaults to 'pod' if omitted.<BR><BR>If there are multiple pods matching the criteria, a pod will be selected automatically. The forwarding session ends when the selected pod terminates, and a rerun of the command is needed to resume forwarding.<BR><BR>Examples:<BR># Listen on ports 5000 and 6000 locally, forwarding data to/from ports 5000 and 6000 in the pod<BR>kubectl port-forward pod/mypod 5000 6000<BR><BR># Listen on ports 5000 and 6000 locally, forwarding data to/from ports 5000 and 6000 in a pod selected by the deployment<BR>kubectl port-forward deployment/mydeployment 5000 6000<BR><BR># Listen on port 8443 locally, forwarding to the targetPort of the service's port named "https" in a pod selected by the service<BR>kubectl port-forward service/myservice 8443:https<BR><BR># Listen on port 8888 locally, forwarding to 5000 in the pod<BR>kubectl port-forward pod/mypod 8888:5000<BR><BR># Listen on port 8888 on all addresses, forwarding to 5000 in the pod<BR>kubectl port-forward --address 0.0.0.0 pod/mypod 8888:5000<BR><BR># Listen on port 8888 on localhost and selected IP, forwarding to 5000 in the pod<BR>kubectl port-forward --address localhost,10.19.21.23 pod/mypod 8888:5000<BR><BR># Listen on a random port locally, forwarding to 5000 in the pod<BR>kubectl port-forward pod/mypod :5000<BR><BR>Options:<BR>--address=[localhost]: Addresses to listen on (comma separated). Only accepts IP addresses or localhost as a value. When localhost is supplied, kubectl will try to bind on both 127.0.0.1 and ::1 and will fail if neither of these addresses are available to bind.<BR>--pod-running-timeout=1m0s: The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running<BR><BR>Usage:<BR>kubectl port-forward TYPE/NAME [options] [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">proxy <span class="tooltiptext">Creates a proxy server or application-level gateway between localhost and the Kubernetes API server. It also allows serving static content over specified HTTP path. All incoming data enters through one port and gets forwarded to the remote Kubernetes API server port, except for the path matching the static content path.<BR><BR>Examples:<BR># To proxy all of the Kubernetes API and nothing else<BR>kubectl proxy --api-prefix=/<BR><BR># To proxy only part of the Kubernetes API and also some static files<BR># You can get pods info with 'curl localhost:8001/api/v1/pods'<BR>kubectl proxy --www=/my/files --www-prefix=/static/ --api-prefix=/api/<BR><BR># To proxy the entire Kubernetes API at a different root<BR># You can get pods info with 'curl localhost:8001/custom/api/v1/pods'<BR>kubectl proxy --api-prefix=/custom/<BR><BR># Run a proxy to the Kubernetes API server on port 8011, serving static content from ./local/www/<BR>kubectl proxy --port=8011 --www=./local/www/<BR><BR># Run a proxy to the Kubernetes API server on an arbitrary local port<BR># The chosen port for the server will be output to stdout<BR>kubectl proxy --port=0<BR><BR># Run a proxy to the Kubernetes API server, changing the API prefix to k8s-api<BR># This makes e.g. the pods API available at localhost:8001/k8s-api/v1/pods/<BR>kubectl proxy --api-prefix=/k8s-api<BR><BR>Options:<BR>--accept-hosts='^localhost$,^127\.0\.0\.1$,^\[::1\]$': Regular expression for hosts that the proxy should accept.<BR>--accept-paths='^.*': Regular expression for paths that the proxy should accept.<BR>--address='127.0.0.1': The IP address on which to serve on.<BR>--api-prefix='/': Prefix to serve the proxied API under.<BR>--append-server-path=false: If true, enables automatic path appending of the kube context server path to each request.<BR>--disable-filter=false: If true, disable request filtering in the proxy. This is dangerous, and can leave you vulnerable to XSRF attacks, when used with an accessible port.<BR>--keepalive=0s: keepalive specifies the keep-alive period for an active network connection. Set to 0 to disable keepalive.<BR>-p, --port=8001: The port on which to run the proxy. Set to 0 to pick a random port.<BR>--reject-methods='^$': Regular expression for HTTP methods that the proxy should reject (example --reject-methods='POST,PUT,PATCH').<BR>--reject-paths='^/api/.*/pods/.*/exec,^/api/.*/pods/.*/attach': Regular expression for paths that the proxy should reject. Paths specified here will be rejected even accepted by --accept-paths.<BR>-u, --unix-socket='': Unix socket on which to run the proxy.<BR>-w, --www='': Also serve static files from the given directory under the specified prefix.<BR>-P, --www-prefix='/static/': Prefix to serve static files under, if static file directory is specified.<BR><BR>Usage:<BR>kubectl proxy [--port=PORT] [--www=static-dir] [--www-prefix=prefix] [--api-prefix=prefix] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">cp <span class="tooltiptext">Copy files and directories to and from containers.<BR><BR>Examples:<BR># !!!Important Note!!!<BR># Requires that the 'tar' binary is present in your container<BR># image. If 'tar' is not present, 'kubectl cp' will fail.<BR>#<BR># For advanced use cases, such as symlinks, wildcard expansion or<BR># file mode preservation, consider using 'kubectl exec'.<BR><BR># Copy /tmp/foo local file to /tmp/bar in a remote pod in namespace (some-namespace)<BR>tar cf - /tmp/foo | kubectl exec -i -n (some-namespace) (some-pod) -- tar xf - -C /tmp/bar<BR><BR># Copy /tmp/foo from a remote pod to /tmp/bar locally<BR>kubectl exec -n (some-namespace) (some-pod) -- tar cf - /tmp/foo | tar xf - -C /tmp/bar<BR><BR># Copy /tmp/foo_dir local directory to /tmp/bar_dir in a remote pod in the default namespace<BR>kubectl cp /tmp/foo_dir (some-pod):/tmp/bar_dir<BR><BR># Copy /tmp/foo local file to /tmp/bar in a remote pod in a specific container<BR>kubectl cp /tmp/foo (some-pod):/tmp/bar -c (specific-container)<BR><BR># Copy /tmp/foo local file to /tmp/bar in a remote pod in namespace (some-namespace)<BR>kubectl cp /tmp/foo (some-namespace)/(some-pod):/tmp/bar<BR><BR># Copy /tmp/foo from a remote pod to /tmp/bar locally<BR>kubectl cp (some-namespace)/(some-pod):/tmp/foo /tmp/bar<BR><BR>Options:<BR>-c, --container='': Container name. If omitted, use the kubectl.kubernetes.io/default-container annotation for selecting the container to be attached or the first container in the pod will be chosen<BR>--no-preserve=false: The copied file/directory's ownership and permissions will not be preserved in the container<BR>--retries=0: Set number of retries to complete a copy operation from a container. Specify 0 to disable or any negative value for infinite retrying. The default is 0 (no retry).<BR><BR>Usage:<BR>kubectl cp (file-spec-src) (file-spec-dest) [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI>
<details closed>
<summary><div class="tooltip">auth <span class="tooltiptext">Inspect authorization<BR><BR>Available Commands:<BR>can-i Check whether an action is allowed<BR>reconcile Reconciles rules for RBAC role, role binding, cluster role, and cluster role binding objects<BR><BR>Usage:<BR>kubectl auth [flags] [options]<BR><BR>Use "kubectl (command) --help" for more information about a given command.<BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div></summary>
<UL>
<LI> <div class="tooltip">can-i <span class="tooltiptext">Check whether an action is allowed.<BR><BR>VERB is a logical Kubernetes API verb like 'get', 'list', 'watch', 'delete', etc. TYPE is a Kubernetes resource. Shortcuts and groups will be resolved. NONRESOURCEURL is a partial URL that starts with "/". NAME is the name of a particular Kubernetes resource. This command pairs nicely with impersonation. See --as global flag.<BR><BR>Examples:<BR># Check to see if I can create pods in any namespace<BR>kubectl auth can-i create pods --all-namespaces<BR><BR># Check to see if I can list deployments in my current namespace<BR>kubectl auth can-i list deployments.apps<BR><BR># Check to see if I can do everything in my current namespace ("*" means all)<BR>kubectl auth can-i '*' '*'<BR><BR># Check to see if I can get the job named "bar" in namespace "foo"<BR>kubectl auth can-i list jobs.batch/bar -n foo<BR><BR># Check to see if I can read pod logs<BR>kubectl auth can-i get pods --subresource=log<BR><BR># Check to see if I can access the URL /logs/<BR>kubectl auth can-i get /logs/<BR><BR># List all allowed actions in namespace "foo"<BR>kubectl auth can-i --list --namespace=foo<BR><BR>Options:<BR>-A, --all-namespaces=false: If true, check the specified action in all namespaces.<BR>--list=false: If true, prints all allowed actions.<BR>--no-headers=false: If true, prints allowed actions without headers<BR>-q, --quiet=false: If true, suppress output and just return the exit code.<BR>--subresource='': SubResource such as pod/log or deployment/scale<BR><BR>Usage:<BR>kubectl auth can-i VERB [TYPE | TYPE/NAME | NONRESOURCEURL] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">reconcile <span class="tooltiptext">Reconciles rules for RBAC role, role binding, cluster role, and cluster role binding objects.<BR><BR>Missing objects are created, and the containing namespace is created for namespaced objects, if required.<BR><BR>Existing roles are updated to include the permissions in the input objects, and remove extra permissions if --remove-extra-permissions is specified.<BR><BR>Existing bindings are updated to include the subjects in the input objects, and remove extra subjects if --remove-extra-subjects is specified.<BR><BR>This is preferred to 'apply' for RBAC resources so that semantically-aware merging of rules and subjects is done.<BR><BR>Examples:<BR># Reconcile RBAC resources from a file<BR>kubectl auth reconcile -f my-rbac-rules.yaml<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to reconcile.<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--remove-extra-permissions=false: If true, removes extra permissions added to roles<BR>--remove-extra-subjects=false: If true, removes extra subjects added to rolebindings<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl auth reconcile -f FILENAME [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
</UL>
</details>
</LI>
<LI> <div class="tooltip">debug <span class="tooltiptext">Debug cluster resources using interactive debugging containers.<BR><BR>'debug' provides automation for common debugging tasks for cluster objects identified by resource and name. Pods will be used by default if no resource is specified.<BR><BR>The action taken by 'debug' varies depending on what resource is specified. Supported actions include:<BR><BR>* Workload: Create a copy of an existing pod with certain attributes changed, for example changing the image tag to a new version.<BR>* Workload: Add an ephemeral container to an already running pod, for example to add debugging utilities without restarting the pod.<BR>* Node: Create a new pod that runs in the node's host namespaces and can access the node's filesystem.<BR><BR>Examples:<BR># Create an interactive debugging session in pod mypod and immediately attach to it.<BR># (requires the EphemeralContainers feature to be enabled in the cluster)<BR>kubectl debug mypod -it --image=busybox<BR><BR># Create a debug container named debugger using a custom automated debugging image.<BR># (requires the EphemeralContainers feature to be enabled in the cluster)<BR>kubectl debug --image=myproj/debug-tools -c debugger mypod<BR><BR># Create a copy of mypod adding a debug container and attach to it<BR>kubectl debug mypod -it --image=busybox --copy-to=my-debugger<BR><BR># Create a copy of mypod changing the command of mycontainer<BR>kubectl debug mypod -it --copy-to=my-debugger --container=mycontainer -- sh<BR><BR># Create a copy of mypod changing all container images to busybox<BR>kubectl debug mypod --copy-to=my-debugger --set-image=*=busybox<BR><BR># Create a copy of mypod adding a debug container and changing container images<BR>kubectl debug mypod -it --copy-to=my-debugger --image=debian --set-image=app=app:debug,sidecar=sidecar:debug<BR><BR># Create an interactive debugging session on a node and immediately attach to it.<BR># The container will run in the host namespaces and the host's filesystem will be mounted at /host<BR>kubectl debug node/mynode -it --image=busybox<BR><BR>Options:<BR>--arguments-only=false: If specified, everything after -- will be passed to the new container as Args instead of Command.<BR>--attach=false: If true, wait for the container to start running, and then attach as if 'kubectl attach ...' were called. Default false, unless '-i/--stdin' is set, in which case the default is true.<BR>-c, --container='': Container name to use for debug container.<BR>--copy-to='': Create a copy of the target Pod with this name.<BR>--env=[]: Environment variables to set in the container.<BR>--image='': Container image to use for debug container.<BR>--image-pull-policy='': The image pull policy for the container. If left empty, this value will not be specified by the client and defaulted by the server.<BR>-q, --quiet=false: If true, suppress informational messages.<BR>--replace=false: When used with '--copy-to', delete the original Pod.<BR>--same-node=false: When used with '--copy-to', schedule the copy of target Pod on the same node.<BR>--set-image=[]: When used with '--copy-to', a list of name=image pairs for changing container images, similar to how 'kubectl set image' works.<BR>--share-processes=true: When used with '--copy-to', enable process namespace sharing in the copy.<BR>-i, --stdin=false: Keep stdin open on the container(s) in the pod, even if nothing is attached.<BR>--target='': When using an ephemeral container, target processes in this container name.<BR>-t, --tty=false: Allocate a TTY for the debugging container.<BR><BR>Usage:<BR>kubectl debug (POD | TYPE[[.VERSION].GROUP]/NAME) [ -- COMMAND [args...] ] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
</UL>
<H2>Advanced Command</H2>
<UL class="tree-padding tree-vertical-lines tree-horizontal-lines tree-summaries tree-markers tree-buttons">
<LI> <div class="tooltip">diff <span class="tooltiptext">Diff configurations specified by file name or stdin between the current online configuration, and the configuration as it would be if applied.<BR><BR>The output is always YAML.<BR><BR>KUBECTL_EXTERNAL_DIFF environment variable can be used to select your own diff command. Users can use external commands with params too, example: KUBECTL_EXTERNAL_DIFF="colordiff -N -u"<BR><BR>By default, the "diff" command available in your path will be run with the "-u" (unified diff) and "-N" (treat absent files as empty) options.<BR><BR>Exit status: 0 No differences were found. 1 Differences were found. )1 Kubectl or diff failed with an error.<BR><BR>Note: KUBECTL_EXTERNAL_DIFF, if used, is expected to follow that convention.<BR><BR>Examples:<BR># Diff resources included in pod.json<BR>kubectl diff -f pod.json<BR><BR># Diff file read from stdin<BR>cat service.yaml | kubectl diff -f -<BR><BR>Options:<BR>--field-manager='kubectl-client-side-apply': Name of the manager used to track field ownership.<BR>-f, --filename=[]: Filename, directory, or URL to files contains the configuration to diff<BR>--force-conflicts=false: If true, server-side apply will force the changes against conflicts.<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)<BR>--server-side=false: If true, apply runs in the server instead of the client.<BR><BR>Usage:<BR>kubectl diff -f FILENAME [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI>
<details closed>
<summary><div class="tooltip">apply <span class="tooltiptext">Apply a configuration to a resource by file name 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'.<BR><BR>JSON and YAML formats are accepted.<BR><BR>Alpha 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.<BR><BR>Examples:<BR># Apply the configuration in pod.json to a pod<BR>kubectl apply -f ./pod.json<BR><BR># Apply resources from a directory containing kustomization.yaml - e.g. dir/kustomization.yaml<BR>kubectl apply -k dir/<BR><BR># Apply the JSON passed into stdin to a pod<BR>cat pod.json | kubectl apply -f -<BR><BR># Note: --prune is still in Alpha<BR># Apply the configuration in manifest.yaml that matches label app=nginx and delete all other resources that are not in the file and match label app=nginx<BR>kubectl apply --prune -f manifest.yaml -l app=nginx<BR><BR># Apply the configuration in manifest.yaml and delete all the other config maps that are not in the file<BR>kubectl apply --prune -f manifest.yaml --all --prune-whitelist=core/v1/ConfigMap<BR><BR>Available Commands:<BR>edit-last-applied Edit latest last-applied-configuration annotations of a resource/object<BR>set-last-applied Set the last-applied-configuration annotation on a live object to match the contents of a file<BR>view-last-applied View the latest last-applied-configuration annotations of a resource/object<BR><BR>Options:<BR>--all=false: Select all resources in the namespace of the specified resource types.<BR>--allow-missing-template-keys=true: 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.<BR>--cascade='background': Must be "background", "orphan", or "foreground". Selects the deletion cascading strategy for the dependents (e.g. Pods created by a ReplicationController). Defaults to background.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-client-side-apply': Name of the manager used to track field ownership.<BR>-f, --filename=[]: that contains the configuration to apply<BR>--force=false: If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation.<BR>--force-conflicts=false: If true, server-side apply will force the changes against conflicts.<BR>--grace-period=-1: Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion).<BR>-k, --kustomize='': Process a kustomization directory. This flag can't be used together with -f or -R.<BR>--openapi-patch=true: If true, use openapi to calculate diff when the openapi presents and the resource can be found in the openapi spec. Otherwise, fall back to use baked-in types.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--overwrite=true: Automatically resolve conflicts between the modified and live configuration by using values from the modified configuration<BR>--prune=false: 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.<BR>--prune-whitelist=[]: Overwrite the default whitelist with (group/version/kind) for --prune<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)<BR>--server-side=false: If true, apply runs in the server instead of the client.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--timeout=0s: The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object<BR>--validate=true: If true, use a schema to validate the input before sending it<BR>--wait=false: If true, wait for resources to be gone before returning. This waits for finalizers.<BR><BR>Usage:<BR>kubectl apply (-f FILENAME | -k DIRECTORY) [options]<BR><BR>Use "kubectl (command) --help" for more information about a given command.<BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div></summary>
<UL>
<LI> <div class="tooltip">edit-last-applied <span class="tooltiptext">Edit the latest last-applied-configuration annotations of resources from the default editor.<BR><BR>The 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 file names as well as command-line arguments, although the files you point to must be previously saved versions of resources.<BR><BR>The default format is YAML. To edit in JSON, specify "-o json".<BR><BR>The flag --windows-line-endings can be used to force Windows line endings, otherwise the default for your operating system will be used.<BR><BR>In 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.<BR><BR>Examples:<BR># Edit the last-applied-configuration annotations by type/name in YAML<BR>kubectl apply edit-last-applied deployment/nginx<BR><BR># Edit the last-applied-configuration annotations by file in JSON<BR>kubectl apply edit-last-applied -f deploy.yaml -o json<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--field-manager='kubectl-client-side-apply': Name of the manager used to track field ownership.<BR>-f, --filename=[]: Filename, directory, or URL to files to use to edit the resource<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--windows-line-endings=false: Defaults to the line ending native to your platform.<BR><BR>Usage:<BR>kubectl apply edit-last-applied (RESOURCE/NAME | -f FILENAME) [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">set-last-applied <span class="tooltiptext">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.<BR><BR>Examples:<BR># Set the last-applied-configuration of a resource to match the contents of a file<BR>kubectl apply set-last-applied -f deploy.yaml<BR><BR># Execute set-last-applied against each configuration file in a directory<BR>kubectl apply set-last-applied -f path/<BR><BR># 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<BR>kubectl apply set-last-applied -f deploy.yaml --create-annotation=true<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--create-annotation=false: Will create 'last-applied-configuration' annotations if current objects doesn't have one<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>-f, --filename=[]: Filename, directory, or URL to files that contains the last-applied-configuration annotations<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl apply set-last-applied -f FILENAME [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">view-last-applied <span class="tooltiptext">View the latest last-applied-configuration annotations by type/name or file.<BR><BR>The default output will be printed to stdout in YAML format. You can use the -o option to change the output format.<BR><BR>Examples:<BR># View the last-applied-configuration annotations by type/name in YAML<BR>kubectl apply view-last-applied deployment/nginx<BR><BR># View the last-applied-configuration annotations by file in JSON<BR>kubectl apply view-last-applied -f deploy.yaml -o json<BR><BR>Options:<BR>--all=false: Select all resources in the namespace of the specified resource types<BR>-f, --filename=[]: Filename, directory, or URL to files that contains the last-applied-configuration annotations<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>-o, --output='yaml': Output format. Must be one of yaml|json<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)<BR><BR>Usage:<BR>kubectl apply view-last-applied (TYPE [NAME | -l label] | TYPE/NAME | -f FILENAME) [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
</UL>
</details>
</LI>
<LI> <div class="tooltip">patch <span class="tooltiptext">Update fields of a resource using strategic merge patch, a JSON merge patch, or a JSON patch.<BR><BR>JSON and YAML formats are accepted.<BR><BR>Examples:<BR># Partially update a node using a strategic merge patch, specifying the patch as JSON<BR>kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}'<BR><BR># Partially update a node using a strategic merge patch, specifying the patch as YAML<BR>kubectl patch node k8s-node-1 -p $'spec:\n unschedulable: true'<BR><BR># Partially update a node identified by the type and name specified in "node.json" using strategic merge patch<BR>kubectl patch -f node.json -p '{"spec":{"unschedulable":true}}'<BR><BR># Update a container's image; spec.containers[*].name is required because it's a merge key<BR>kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve-hostname","image":"new image"}]}}'<BR><BR># Update a container's image using a JSON patch with positional arrays<BR>kubectl patch pod valid-pod --type='json' -p='[{"op": "replace", "path": "/spec/containers/0/image", "value":"new image"}]'<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-patch': Name of the manager used to track field ownership.<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to update<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>--local=false: If true, patch will operate on the content of the file, not the server-side resource.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>-p, --patch='': The patch to be applied to the resource JSON file.<BR>--patch-file='': A file containing a patch to be applied to the resource.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--type='strategic': The type of patch being provided; one of [json merge strategic]<BR><BR>Usage:<BR>kubectl patch (-f FILENAME | TYPE NAME) [-p PATCH|--patch-file FILE] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">replace <span class="tooltiptext">Replace a resource by file name or stdin.<BR><BR>JSON and YAML formats are accepted. If replacing an existing resource, the complete resource spec must be provided. This can be obtained by<BR><BR>$ kubectl get TYPE NAME -o yaml<BR><BR>Examples:<BR># Replace a pod using the data in pod.json<BR>kubectl replace -f ./pod.json<BR><BR># Replace a pod based on the JSON passed into stdin<BR>cat pod.json | kubectl replace -f -<BR><BR># Update a single-container pod's image version (tag) to v4<BR>kubectl get pod mypod -o yaml | sed 's/\(image: myimage\):.*$/\1:v4/' | kubectl replace -f -<BR><BR># Force replace, delete and then re-create the resource<BR>kubectl replace --force -f ./pod.json<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--cascade='background': Must be "background", "orphan", or "foreground". Selects the deletion cascading strategy for the dependents (e.g. Pods created by a ReplicationController). Defaults to background.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-replace': Name of the manager used to track field ownership.<BR>-f, --filename=[]: to use to replace the resource.<BR>--force=false: If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation.<BR>--grace-period=-1: Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion).<BR>-k, --kustomize='': Process a kustomization directory. This flag can't be used together with -f or -R.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--raw='': Raw URI to PUT to the server. Uses the transport specified by the kubeconfig file.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--timeout=0s: The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object<BR>--validate=true: If true, use a schema to validate the input before sending it<BR>--wait=false: If true, wait for resources to be gone before returning. This waits for finalizers.<BR><BR>Usage:<BR>kubectl replace -f FILENAME [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">wait <span class="tooltiptext">Experimental: Wait for a specific condition on one or many resources.<BR><BR>The command takes multiple resources and waits until the specified condition is seen in the Status field of every given resource.<BR><BR>Alternatively, the command can wait for the given set of resources to be deleted by providing the "delete" keyword as the value to the --for flag.<BR><BR>A successful message will be printed to stdout indicating when the specified condition has been met. You can use -o option to change to output destination.<BR><BR>Examples:<BR># Wait for the pod "busybox1" to contain the status condition of type "Ready"<BR>kubectl wait --for=condition=Ready pod/busybox1<BR><BR># The default value of status condition is true; you can set it to false<BR>kubectl wait --for=condition=Ready=false pod/busybox1<BR><BR># Wait for the pod "busybox1" to contain the status phase to be "Running".<BR>kubectl wait --for=jsonpath='{.status.phase}'=Running pod/busybox1<BR><BR># Wait for the pod "busybox1" to be deleted, with a timeout of 60s, after having issued the "delete" command<BR>kubectl delete pod/busybox1<BR>kubectl wait --for=delete pod/busybox1 --timeout=60s<BR><BR>Options:<BR>--all=false: Select all resources in the namespace of the specified resource types<BR>-A, --all-namespaces=false: If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.<BR>--allow-missing-template-keys=true: 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.<BR>--field-selector='': Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.<BR>-f, --filename=[]: identifying the resource.<BR>--for='': The condition to wait on: [delete|condition=condition-name|jsonpath='{JSONPath expression}'=JSONPath Condition]. The default status value of condition-name is true, you can set false with condition=condition-name=false.<BR>--local=false: If true, annotation will NOT contact api-server but run locally.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>-R, --recursive=true: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR>--timeout=30s: The length of time to wait before giving up. Zero means check once and don't wait, negative means wait for a week.<BR><BR>Usage:<BR>kubectl wait ([-f FILENAME] | resource.group/resource.name | resource.group [(-l label | --all)]) [--for=delete|--for condition=available|--for=jsonpath='{}'=value] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">kustomize <span class="tooltiptext">Build a set of KRM resources using a 'kustomization.yaml' file. The DIR argument must be a path to a directory containing 'kustomization.yaml', or a git repository URL with a path suffix specifying same with respect to the repository root. If DIR is omitted, '.' is assumed.<BR><BR>Examples:<BR># Build the current working directory<BR>kubectl kustomize<BR><BR># Build some shared configuration directory<BR>kubectl kustomize /home/config/production<BR><BR># Build from github<BR>kubectl kustomize https://github.com/kubernetes-sigs/kustomize.git/examples/helloWorld?ref=v1.0.6<BR><BR>Options:<BR>--as-current-user=false: use the uid and gid of the command executor to run the function in the container<BR>--enable-alpha-plugins=false: enable kustomize plugins<BR>--enable-helm=false: Enable use of the Helm chart inflator generator.<BR>--enable-managedby-label=false: enable adding app.kubernetes.io/managed-by<BR>-e, --env=[]: a list of environment variables to be used by functions<BR>--helm-command='helm': helm command (path to executable)<BR>--load-restrictor='LoadRestrictionsRootOnly': if set to 'LoadRestrictionsNone', local kustomizations may load files from outside their root. This does, however, break the relocatability of the kustomization.<BR>--mount=[]: a list of storage options read from the filesystem<BR>--network=false: enable network access for functions that declare it<BR>--network-name='bridge': the docker network to run the container in<BR>-o, --output='': If specified, write output to this path.<BR>--reorder='legacy': Reorder the resources just before output. Use 'legacy' to apply a legacy reordering (Namespaces first, Webhooks last, etc). Use 'none' to suppress a final reordering.<BR><BR>Usage:<BR>kubectl kustomize DIR [flags] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
</UL>
<H2>Settings Commands</H2>
<UL class="tree-padding tree-vertical-lines tree-horizontal-lines tree-summaries tree-markers tree-buttons">
<LI> <div class="tooltip">label <span class="tooltiptext">Update the labels on a resource.<BR><BR>* A label key and value must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to 63 characters each.<BR>* Optionally, the key can begin with a DNS subdomain prefix and a single '/', like example.com/my-app.<BR>* If --overwrite is true, then existing labels can be overwritten, otherwise attempting to overwrite a label will result in an error.<BR>* If --resource-version is specified, then updates will use this resource version, otherwise the existing resource-version will be used.<BR><BR>Examples:<BR># Update pod 'foo' with the label 'unhealthy' and the value 'true'<BR>kubectl label pods foo unhealthy=true<BR><BR># Update pod 'foo' with the label 'status' and the value 'unhealthy', overwriting any existing value<BR>kubectl label --overwrite pods foo status=unhealthy<BR><BR># Update all pods in the namespace<BR>kubectl label pods --all status=unhealthy<BR><BR># Update a pod identified by the type and name in "pod.json"<BR>kubectl label -f pod.json status=unhealthy<BR><BR># Update pod 'foo' only if the resource is unchanged from version 1<BR>kubectl label pods foo status=unhealthy --resource-version=1<BR><BR># Update pod 'foo' by removing a label named 'bar' if it exists<BR># Does not require the --overwrite flag<BR>kubectl label pods foo bar-<BR><BR>Options:<BR>--all=false: Select all resources, in the namespace of the specified resource types<BR>-A, --all-namespaces=false: If true, check the specified action in all namespaces.<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-label': Name of the manager used to track field ownership.<BR>--field-selector='': Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to update the labels<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>--list=false: If true, display the labels for a given resource.<BR>--local=false: If true, label will NOT contact api-server but run locally.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--overwrite=false: If true, allow labels to be overwritten, otherwise reject label updates that overwrite existing labels.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--resource-version='': If non-empty, the labels update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.<BR>-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2).<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl label [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">annotate <span class="tooltiptext">Update the annotations on one or more resources.<BR><BR>All Kubernetes objects support the ability to store additional data with the object as annotations. Annotations are key/value pairs that can be larger than labels and include arbitrary string values such as structured JSON. Tools and system extensions may use annotations to store their own data.<BR><BR>Attempting to set an annotation that already exists will fail unless --overwrite is set. If --resource-version is specified and does not match the current resource version on the server the command will fail.<BR><BR>Use "kubectl api-resources" for a complete list of supported resources.<BR><BR>Examples:<BR># Update pod 'foo' with the annotation 'description' and the value 'my frontend'<BR># If the same annotation is set multiple times, only the last value will be applied<BR>kubectl annotate pods foo description='my frontend'<BR><BR># Update a pod identified by type and name in "pod.json"<BR>kubectl annotate -f pod.json description='my frontend'<BR><BR># Update pod 'foo' with the annotation 'description' and the value 'my frontend running nginx', overwriting any existing value<BR>kubectl annotate --overwrite pods foo description='my frontend running nginx'<BR><BR># Update all pods in the namespace<BR>kubectl annotate pods --all description='my frontend running nginx'<BR><BR># Update pod 'foo' only if the resource is unchanged from version 1<BR>kubectl annotate pods foo description='my frontend running nginx' --resource-version=1<BR><BR># Update pod 'foo' by removing an annotation named 'description' if it exists<BR># Does not require the --overwrite flag<BR>kubectl annotate pods foo description-<BR><BR>Options:<BR>--all=false: Select all resources, in the namespace of the specified resource types.<BR>-A, --all-namespaces=false: If true, check the specified action in all namespaces.<BR>--allow-missing-template-keys=true: 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.<BR>--dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.<BR>--field-manager='kubectl-annotate': Name of the manager used to track field ownership.<BR>--field-selector='': Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.<BR>-f, --filename=[]: Filename, directory, or URL to files identifying the resource to update the annotation<BR>-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.<BR>--list=false: If true, display the annotations for a given resource.<BR>--local=false: If true, annotation will NOT contact api-server but run locally.<BR>-o, --output='': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--overwrite=false: If true, allow annotations to be overwritten, otherwise reject annotation updates that overwrite existing annotations.<BR>-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.<BR>--resource-version='': 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.<BR>-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2).<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl annotate [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">completion <span class="tooltiptext">Output shell completion code for the specified shell (bash, zsh, fish, or powershell). The shell code must be evaluated to provide interactive completion of kubectl commands. This can be done by sourcing it from the .bash_profile.<BR><BR>Detailed instructions on how to do this are available here:<BR><BR>for macOS:<BR>https://kubernetes.io/docs/tasks/tools/install-kubectl-macos/#enable-shell-autocompletion<BR><BR>for linux:<BR>https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#enable-shell-autocompletion<BR><BR>for windows:<BR>https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/#enable-shell-autocompletion<BR><BR>Note for zsh users: [1] zsh completions are only supported in versions of zsh )= 5.2.<BR><BR>Examples:<BR># Installing bash completion on macOS using homebrew<BR>## If running Bash 3.2 included with macOS<BR>brew install bash-completion<BR>## or, if running Bash 4.1+<BR>brew install bash-completion@2<BR>## If kubectl is installed via homebrew, this should start working immediately<BR>## If you've installed via other means, you may need add the completion to your completion directory<BR>kubectl completion bash ) $(brew --prefix)/etc/bash_completion.d/kubectl<BR><BR><BR># Installing bash completion on Linux<BR>## If bash-completion is not installed on Linux, install the 'bash-completion' package<BR>## via your distribution's package manager.<BR>## Load the kubectl completion code for bash into the current shell<BR>source ((kubectl completion bash)<BR>## Write bash completion code to a file and source it from .bash_profile<BR>kubectl completion bash ) ~/.kube/completion.bash.inc<BR>printf "<BR># Kubectl shell completion<BR>source '$HOME/.kube/completion.bash.inc'<BR>" )) $HOME/.bash_profile<BR>source $HOME/.bash_profile<BR><BR># Load the kubectl completion code for zsh[1] into the current shell<BR>source ((kubectl completion zsh)<BR># Set the kubectl completion code for zsh[1] to autoload on startup<BR>kubectl completion zsh ) "${fpath[1]}/_kubectl"<BR><BR><BR># Load the kubectl completion code for fish[2] into the current shell<BR>kubectl completion fish | source<BR># To load completions for each session, execute once:<BR>kubectl completion fish ) ~/.config/fish/completions/kubectl.fish<BR><BR># Load the kubectl completion code for powershell into the current shell<BR>kubectl completion powershell | Out-String | Invoke-Expression<BR># Set kubectl completion code for powershell to run on startup<BR>## Save completion code to a script and execute in the profile<BR>kubectl completion powershell ) $HOME\.kube\completion.ps1<BR>Add-Content $PROFILE "$HOME\.kube\completion.ps1"<BR>## Execute completion code in the profile<BR>Add-Content $PROFILE "if (Get-Command kubectl -ErrorAction SilentlyContinue) {<BR>kubectl completion powershell | Out-String | Invoke-Expression<BR>}"<BR>## Add completion code directly to the $PROFILE script<BR>kubectl completion powershell )) $PROFILE<BR><BR>Usage:<BR>kubectl completion SHELL [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
</UL>
<H2>Other Commands</H2>
<UL class="tree-padding tree-vertical-lines tree-horizontal-lines tree-summaries tree-markers tree-buttons">
<LI>
<details closed>
<summary><div class="tooltip">alpha <span class="tooltiptext">These commands correspond to alpha features that are not enabled in Kubernetes clusters by default.<BR><BR>Available Commands:<BR>events Experimental: List events<BR><BR>Use "kubectl (command) --help" for more information about a given command.</span> </div></summary>
<UL>
<LI> <div class="tooltip">events <span class="tooltiptext">Experimental: Display events<BR><BR>Prints a table of the most important information about events. You can request events for a namespace, for all namespace, or filtered to only those pertaining to a specified resource.<BR><BR>Examples:<BR># List recent events in the default namespace.<BR>kubectl alpha events<BR><BR># List recent events in all namespaces.<BR>kubectl alpha events --all-namespaces<BR><BR># List recent events for the specified pod, then wait for more events and list them as they arrive.<BR>kubectl alpha events --for pod/web-pod-13je7 --watch<BR><BR>Options:<BR>-A, --all-namespaces=false: If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.<BR>--chunk-size=500: Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.<BR>--for='': Filter events to only those pertaining to the specified resource.<BR>-w, --watch=false: After listing the requested events, watch for more events.<BR><BR>Usage:<BR>kubectl alpha events [--for TYPE/NAME] [--watch] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
</UL>
</details>
</LI>
<LI> <div class="tooltip">api-resources <span class="tooltiptext">Print the supported API resources on the server.<BR><BR>Examples:<BR># Print the supported API resources<BR>kubectl api-resources<BR><BR># Print the supported API resources with more information<BR>kubectl api-resources -o wide<BR><BR># Print the supported API resources sorted by a column<BR>kubectl api-resources --sort-by=name<BR><BR># Print the supported namespaced resources<BR>kubectl api-resources --namespaced=true<BR><BR># Print the supported non-namespaced resources<BR>kubectl api-resources --namespaced=false<BR><BR># Print the supported API resources with a specific APIGroup<BR>kubectl api-resources --api-group=extensions<BR><BR>Options:<BR>--api-group='': Limit to resources in the specified API group.<BR>--cached=false: Use the cached list of resources if available.<BR>--namespaced=true: If false, non-namespaced resources will be returned, otherwise returning namespaced resources by default.<BR>--no-headers=false: When using the default or custom-column output format, don't print headers (default print headers).<BR>-o, --output='': Output format. One of: wide|name.<BR>--sort-by='': If non-empty, sort list of resources using specified field. The field can be either 'name' or 'kind'.<BR>--verbs=[]: Limit to resources that support the specified verbs.<BR><BR>Usage:<BR>kubectl api-resources [flags] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">api-versions <span class="tooltiptext">Print the supported API versions on the server, in the form of "group/version".<BR><BR>Examples:<BR># Print the supported API versions<BR>kubectl api-versions<BR><BR>Usage:<BR>kubectl api-versions [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI>
<details closed>
<summary><div class="tooltip">config <span class="tooltiptext">Modify kubeconfig files using subcommands like "kubectl config set current-context my-context"<BR><BR>The loading order follows these rules:<BR><BR>1. If the --kubeconfig flag is set, then only that file is loaded. The flag may only be set once and no merging takes place.<BR>2. If $KUBECONFIG environment variable is set, then it is used as a list of paths (normal path delimiting rules for your system). These paths are merged. When a value is modified, it is modified in the file that defines the stanza. When a value is created, it is created in the first file that exists. If no files in the chain exist, then it creates the last file in the list.<BR>3. Otherwise, ${HOME}/.kube/config is used and no merging takes place.<BR><BR>Available Commands:<BR>current-context Display the current-context<BR>delete-cluster Delete the specified cluster from the kubeconfig<BR>delete-context Delete the specified context from the kubeconfig<BR>delete-user Delete the specified user from the kubeconfig<BR>get-clusters Display clusters defined in the kubeconfig<BR>get-contexts Describe one or many contexts<BR>get-users Display users defined in the kubeconfig<BR>rename-context Rename a context from the kubeconfig file<BR>set Set an individual value in a kubeconfig file<BR>set-cluster Set a cluster entry in kubeconfig<BR>set-context Set a context entry in kubeconfig<BR>set-credentials Set a user entry in kubeconfig<BR>unset Unset an individual value in a kubeconfig file<BR>use-context Set the current-context in a kubeconfig file<BR>view Display merged kubeconfig settings or a specified kubeconfig file<BR><BR>Usage:<BR>kubectl config SUBCOMMAND [options]<BR><BR>Use "kubectl (command) --help" for more information about a given command.<BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div></summary>
<UL>
<LI> <div class="tooltip">current-context <span class="tooltiptext">Display the current-context.<BR><BR>Examples:<BR># Display the current-context<BR>kubectl config current-context<BR><BR>Usage:<BR>kubectl config current-context [flags] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">delete-cluster <span class="tooltiptext">Delete the specified cluster from the kubeconfig.<BR><BR>Examples:<BR># Delete the minikube cluster<BR>kubectl config delete-cluster minikube<BR><BR>Usage:<BR>kubectl config delete-cluster NAME [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">delete-context <span class="tooltiptext">Delete the specified context from the kubeconfig.<BR><BR>Examples:<BR># Delete the context for the minikube cluster<BR>kubectl config delete-context minikube<BR><BR>Usage:<BR>kubectl config delete-context NAME [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">delete-user <span class="tooltiptext">Delete the specified user from the kubeconfig.<BR><BR>Examples:<BR># Delete the minikube user<BR>kubectl config delete-user minikube<BR><BR>Usage:<BR>kubectl config delete-user NAME [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">get-clusters <span class="tooltiptext">Display clusters defined in the kubeconfig.<BR><BR>Examples:<BR># List the clusters that kubectl knows about<BR>kubectl config get-clusters<BR><BR>Usage:<BR>kubectl config get-clusters [flags] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">get-contexts <span class="tooltiptext">Display one or many contexts from the kubeconfig file.<BR><BR>Examples:<BR># List all the contexts in your kubeconfig file<BR>kubectl config get-contexts<BR><BR># Describe one context in your kubeconfig file<BR>kubectl config get-contexts my-context<BR><BR>Options:<BR>--no-headers=false: When using the default or custom-column output format, don't print headers (default print headers).<BR>-o, --output='': Output format. One of: name<BR><BR>Usage:<BR>kubectl config get-contexts [(-o|--output=)name)] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">get-users <span class="tooltiptext">Display users defined in the kubeconfig.<BR><BR>Examples:<BR># List the users that kubectl knows about<BR>kubectl config get-users<BR><BR>Usage:<BR>kubectl config get-users [flags] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">rename-context <span class="tooltiptext">Renames a context from the kubeconfig file.<BR><BR>CONTEXT_NAME is the context name that you want to change.<BR><BR>NEW_NAME is the new name you want to set.<BR><BR>Note: If the context being renamed is the 'current-context', this field will also be updated.<BR><BR>Examples:<BR># Rename the context 'old-name' to 'new-name' in your kubeconfig file<BR>kubectl config rename-context old-name new-name<BR><BR>Usage:<BR>kubectl config rename-context CONTEXT_NAME NEW_NAME [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">set <span class="tooltiptext">Set an individual value in a kubeconfig file.<BR><BR>PROPERTY_NAME is a dot delimited name where each token represents either an attribute name or a map key. Map keys may not contain dots.<BR><BR>PROPERTY_VALUE is the new value you want to set. Binary fields such as 'certificate-authority-data' expect a base64 encoded string unless the --set-raw-bytes flag is used.<BR><BR>Specifying an attribute name that already exists will merge new fields on top of existing values.<BR><BR>Examples:<BR># Set the server field on the my-cluster cluster to https://1.2.3.4<BR>kubectl config set clusters.my-cluster.server https://1.2.3.4<BR><BR># Set the certificate-authority-data field on the my-cluster cluster<BR>kubectl config set clusters.my-cluster.certificate-authority-data $(echo "cert_data_here" | base64 -i -)<BR><BR># Set the cluster field in the my-context context to my-cluster<BR>kubectl config set contexts.my-context.cluster my-cluster<BR><BR># Set the client-key-data field in the cluster-admin user using --set-raw-bytes option<BR>kubectl config set users.cluster-admin.client-key-data cert_data_here --set-raw-bytes=true<BR><BR>Options:<BR>--set-raw-bytes=false: When writing a []byte PROPERTY_VALUE, write the given string directly without base64 decoding.<BR><BR>Usage:<BR>kubectl config set PROPERTY_NAME PROPERTY_VALUE [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">set-cluster <span class="tooltiptext">Set a cluster entry in kubeconfig.<BR><BR>Specifying a name that already exists will merge new fields on top of existing values for those fields.<BR><BR>Examples:<BR># Set only the server field on the e2e cluster entry without touching other values<BR>kubectl config set-cluster e2e --server=https://1.2.3.4<BR><BR># Embed certificate authority data for the e2e cluster entry<BR>kubectl config set-cluster e2e --embed-certs --certificate-authority=~/.kube/e2e/kubernetes.ca.crt<BR><BR># Disable cert checking for the dev cluster entry<BR>kubectl config set-cluster e2e --insecure-skip-tls-verify=true<BR><BR># Set custom TLS server name to use for validation for the e2e cluster entry<BR>kubectl config set-cluster e2e --tls-server-name=my-cluster-name<BR><BR>Options:<BR>--embed-certs=false: embed-certs for the cluster entry in kubeconfig<BR><BR>Usage:<BR>kubectl config set-cluster NAME [--server=server] [--certificate-authority=path/to/certificate/authority] [--insecure-skip-tls-verify=true] [--tls-server-name=example.com] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">set-context <span class="tooltiptext">Set a context entry in kubeconfig.<BR><BR>Specifying a name that already exists will merge new fields on top of existing values for those fields.<BR><BR>Examples:<BR># Set the user field on the gce context entry without touching other values<BR>kubectl config set-context gce --user=cluster-admin<BR><BR>Options:<BR>--current=false: Modify the current context<BR><BR>Usage:<BR>kubectl config set-context [NAME | --current] [--cluster=cluster_nickname] [--user=user_nickname] [--namespace=namespace] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">set-credentials <span class="tooltiptext">Set a user entry in kubeconfig.<BR><BR>Specifying a name that already exists will merge new fields on top of existing values.<BR><BR>Client-certificate flags:<BR>--client-certificate=certfile --client-key=keyfile<BR><BR>Bearer token flags:<BR>--token=bearer_token<BR><BR>Basic auth flags:<BR>--username=basic_user --password=basic_password<BR><BR>Bearer token and basic auth are mutually exclusive.<BR><BR>Examples:<BR># Set only the "client-key" field on the "cluster-admin"<BR># entry, without touching other values<BR>kubectl config set-credentials cluster-admin --client-key=~/.kube/admin.key<BR><BR># Set basic auth for the "cluster-admin" entry<BR>kubectl config set-credentials cluster-admin --username=admin --password=uXFGweU9l35qcif<BR><BR># Embed client certificate data in the "cluster-admin" entry<BR>kubectl config set-credentials cluster-admin --client-certificate=~/.kube/admin.crt --embed-certs=true<BR><BR># Enable the Google Compute Platform auth provider for the "cluster-admin" entry<BR>kubectl config set-credentials cluster-admin --auth-provider=gcp<BR><BR># Enable the OpenID Connect auth provider for the "cluster-admin" entry with additional args<BR>kubectl config set-credentials cluster-admin --auth-provider=oidc --auth-provider-arg=client-id=foo --auth-provider-arg=client-secret=bar<BR><BR># Remove the "client-secret" config value for the OpenID Connect auth provider for the "cluster-admin" entry<BR>kubectl config set-credentials cluster-admin --auth-provider=oidc --auth-provider-arg=client-secret-<BR><BR># Enable new exec auth plugin for the "cluster-admin" entry<BR>kubectl config set-credentials cluster-admin --exec-command=/path/to/the/executable --exec-api-version=client.authentication.k8s.io/v1beta1<BR><BR># Define new exec auth plugin args for the "cluster-admin" entry<BR>kubectl config set-credentials cluster-admin --exec-arg=arg1 --exec-arg=arg2<BR><BR># Create or update exec auth plugin environment variables for the "cluster-admin" entry<BR>kubectl config set-credentials cluster-admin --exec-env=key1=val1 --exec-env=key2=val2<BR><BR># Remove exec auth plugin environment variables for the "cluster-admin" entry<BR>kubectl config set-credentials cluster-admin --exec-env=var-to-remove-<BR><BR>Options:<BR>--auth-provider='': Auth provider for the user entry in kubeconfig<BR>--auth-provider-arg=[]: 'key=value' arguments for the auth provider<BR>--embed-certs=false: Embed client cert/key for the user entry in kubeconfig<BR>--exec-api-version='': API version of the exec credential plugin for the user entry in kubeconfig<BR>--exec-arg=[]: New arguments for the exec credential plugin command for the user entry in kubeconfig<BR>--exec-command='': Command for the exec credential plugin for the user entry in kubeconfig<BR>--exec-env=[]: 'key=value' environment values for the exec credential plugin<BR><BR>Usage:<BR>kubectl config set-credentials NAME [--client-certificate=path/to/certfile] [--client-key=path/to/keyfile] [--token=bearer_token] [--username=basic_user] [--password=basic_password] [--auth-provider=provider_name] [--auth-provider-arg=key=value] [--exec-command=exec_command] [--exec-api-version=exec_api_version] [--exec-arg=arg] [--exec-env=key=value] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">unset <span class="tooltiptext">Unset an individual value in a kubeconfig file.<BR><BR>PROPERTY_NAME is a dot delimited name where each token represents either an attribute name or a map key. Map keys may not contain dots.<BR><BR>Examples:<BR># Unset the current-context<BR>kubectl config unset current-context<BR><BR># Unset namespace in foo context<BR>kubectl config unset contexts.foo.namespace<BR><BR>Usage:<BR>kubectl config unset PROPERTY_NAME [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">use-context <span class="tooltiptext">Set the current-context in a kubeconfig file.<BR><BR>Aliases:<BR>use-context, use<BR><BR>Examples:<BR># Use the context for the minikube cluster<BR>kubectl config use-context minikube<BR><BR>Usage:<BR>kubectl config use-context CONTEXT_NAME [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
<LI> <div class="tooltip">view <span class="tooltiptext">Display merged kubeconfig settings or a specified kubeconfig file.<BR><BR>You can use --output jsonpath={...} to extract specific values using a jsonpath expression.<BR><BR>Examples:<BR># Show merged kubeconfig settings<BR>kubectl config view<BR><BR># Show merged kubeconfig settings and raw certificate data<BR>kubectl config view --raw<BR><BR># Get the password for the e2e user<BR>kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'<BR><BR>Options:<BR>--allow-missing-template-keys=true: 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.<BR>--flatten=false: Flatten the resulting kubeconfig file into self-contained output (useful for creating portable kubeconfig files)<BR>--merge=true: Merge the full hierarchy of kubeconfig files<BR>--minify=false: Remove all information not used by current-context from the output<BR>-o, --output='yaml': Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.<BR>--raw=false: Display raw byte data<BR>--show-managed-fields=false: If true, keep the managedFields when printing objects in JSON or YAML format.<BR>--template='': 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].<BR><BR>Usage:<BR>kubectl config view [flags] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
</UL>
</details>
</LI>
<LI>
<details closed>
<summary><div class="tooltip">plugin <span class="tooltiptext">Provides utilities for interacting with plugins.<BR><BR>Plugins provide extended functionality that is not part of the major command-line distribution. Please refer to the documentation and examples for more information about how write your own plugins.<BR><BR>The easiest way to discover and install plugins is via the kubernetes sub-project krew. To install krew, visit https://krew.sigs.k8s.io/docs/user-guide/setup/install/<BR><BR>Available Commands:<BR>list List all visible plugin executables on a user's PATH<BR><BR>Usage:<BR>kubectl plugin [flags] [options]<BR><BR>Use "kubectl (command) --help" for more information about a given command.<BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div></summary>
<UL>
<LI> <div class="tooltip">list <span class="tooltiptext">List all available plugin files on a user's PATH.<BR><BR>Available plugin files are those that are: - executable - anywhere on the user's PATH - begin with "kubectl-"<BR><BR>Options:<BR>--name-only=false: If true, display only the binary name of each plugin, rather than its full path<BR><BR>Usage:<BR>kubectl plugin list [flags] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
</UL>
</details>
</LI>
<LI> <div class="tooltip">version <span class="tooltiptext">Print the client and server version information for the current context.<BR><BR>Examples:<BR># Print the client and server versions for the current context<BR>kubectl version<BR><BR>Options:<BR>--client=false: If true, shows client version only (no server required).<BR>-o, --output='': One of 'yaml' or 'json'.<BR>--short=false: If true, print just the version number.<BR><BR>Usage:<BR>kubectl version [flags] [options]<BR><BR>Use "kubectl options" for a list of global command-line options (applies to all commands).</span> </div> </LI>
</UL>
</main>
<footer>
Please Share this API Explorer
</footer>
</body>
</html>