Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit e8b9dde

Browse files
committed
new kubectl explain command
1 parent 495433f commit e8b9dde

File tree

12 files changed

+622
-2
lines changed

12 files changed

+622
-2
lines changed

.generated_docs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ docs/man/man1/kubectl-delete.1
1717
docs/man/man1/kubectl-describe.1
1818
docs/man/man1/kubectl-edit.1
1919
docs/man/man1/kubectl-exec.1
20+
docs/man/man1/kubectl-explain.1
2021
docs/man/man1/kubectl-expose.1
2122
docs/man/man1/kubectl-get.1
2223
docs/man/man1/kubectl-label.1
@@ -50,6 +51,7 @@ docs/user-guide/kubectl/kubectl_delete.md
5051
docs/user-guide/kubectl/kubectl_describe.md
5152
docs/user-guide/kubectl/kubectl_edit.md
5253
docs/user-guide/kubectl/kubectl_exec.md
54+
docs/user-guide/kubectl/kubectl_explain.md
5355
docs/user-guide/kubectl/kubectl_expose.md
5456
docs/user-guide/kubectl/kubectl_get.md
5557
docs/user-guide/kubectl/kubectl_label.md

contrib/completions/bash/kubectl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,22 @@ _kubectl_version()
11051105
must_have_one_noun=()
11061106
}
11071107

1108+
_kubectl_explain()
1109+
{
1110+
last_command="kubectl_explain"
1111+
commands=()
1112+
1113+
flags=()
1114+
two_word_flags=()
1115+
flags_with_completion=()
1116+
flags_completion=()
1117+
1118+
flags+=("--recursive")
1119+
1120+
must_have_one_flag=()
1121+
must_have_one_noun=()
1122+
}
1123+
11081124
_kubectl()
11091125
{
11101126
last_command="kubectl"
@@ -1133,6 +1149,7 @@ _kubectl()
11331149
commands+=("cluster-info")
11341150
commands+=("api-versions")
11351151
commands+=("version")
1152+
commands+=("explain")
11361153

11371154
flags=()
11381155
two_word_flags=()

docs/man/man1/.files_generated

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ kubectl-delete.1
1515
kubectl-describe.1
1616
kubectl-edit.1
1717
kubectl-exec.1
18+
kubectl-explain.1
1819
kubectl-expose.1
1920
kubectl-get.1
2021
kubectl-label.1

docs/man/man1/kubectl-explain.1

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" ""
2+
3+
4+
.SH NAME
5+
.PP
6+
kubectl explain \- Documentation of resources.
7+
8+
9+
.SH SYNOPSIS
10+
.PP
11+
\fBkubectl explain\fP [OPTIONS]
12+
13+
14+
.SH DESCRIPTION
15+
.PP
16+
Documentation of resources.
17+
18+
.PP
19+
Possible resource types include: pods (po), services (svc),
20+
replicationcontrollers (rc), nodes (no), events (ev), componentstatuses (cs),
21+
limitranges (limits), persistentvolumes (pv), persistentvolumeclaims (pvc),
22+
resourcequotas (quota), namespaces (ns) or endpoints (ep).
23+
24+
25+
.SH OPTIONS
26+
.PP
27+
\fB\-\-recursive\fP=false
28+
Print the fields of fields (Currently only 1 level deep)
29+
30+
31+
.SH OPTIONS INHERITED FROM PARENT COMMANDS
32+
.PP
33+
\fB\-\-alsologtostderr\fP=false
34+
log to standard error as well as files
35+
36+
.PP
37+
\fB\-\-api\-version\fP=""
38+
The API version to use when talking to the server
39+
40+
.PP
41+
\fB\-\-certificate\-authority\fP=""
42+
Path to a cert. file for the certificate authority.
43+
44+
.PP
45+
\fB\-\-client\-certificate\fP=""
46+
Path to a client key file for TLS.
47+
48+
.PP
49+
\fB\-\-client\-key\fP=""
50+
Path to a client key file for TLS.
51+
52+
.PP
53+
\fB\-\-cluster\fP=""
54+
The name of the kubeconfig cluster to use
55+
56+
.PP
57+
\fB\-\-context\fP=""
58+
The name of the kubeconfig context to use
59+
60+
.PP
61+
\fB\-\-insecure\-skip\-tls\-verify\fP=false
62+
If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
63+
64+
.PP
65+
\fB\-\-kubeconfig\fP=""
66+
Path to the kubeconfig file to use for CLI requests.
67+
68+
.PP
69+
\fB\-\-log\-backtrace\-at\fP=:0
70+
when logging hits line file:N, emit a stack trace
71+
72+
.PP
73+
\fB\-\-log\-dir\fP=""
74+
If non\-empty, write log files in this directory
75+
76+
.PP
77+
\fB\-\-log\-flush\-frequency\fP=5s
78+
Maximum number of seconds between log flushes
79+
80+
.PP
81+
\fB\-\-logtostderr\fP=true
82+
log to standard error instead of files
83+
84+
.PP
85+
\fB\-\-match\-server\-version\fP=false
86+
Require server version to match client version
87+
88+
.PP
89+
\fB\-\-namespace\fP=""
90+
If present, the namespace scope for this CLI request.
91+
92+
.PP
93+
\fB\-\-password\fP=""
94+
Password for basic authentication to the API server.
95+
96+
.PP
97+
\fB\-s\fP, \fB\-\-server\fP=""
98+
The address and port of the Kubernetes API server
99+
100+
.PP
101+
\fB\-\-stderrthreshold\fP=2
102+
logs at or above this threshold go to stderr
103+
104+
.PP
105+
\fB\-\-token\fP=""
106+
Bearer token for authentication to the API server.
107+
108+
.PP
109+
\fB\-\-user\fP=""
110+
The name of the kubeconfig user to use
111+
112+
.PP
113+
\fB\-\-username\fP=""
114+
Username for basic authentication to the API server.
115+
116+
.PP
117+
\fB\-\-v\fP=0
118+
log level for V logs
119+
120+
.PP
121+
\fB\-\-vmodule\fP=
122+
comma\-separated list of pattern=N settings for file\-filtered logging
123+
124+
125+
.SH EXAMPLE
126+
.PP
127+
.RS
128+
129+
.nf
130+
# Get the documentation of the resource and its fields
131+
$ kubectl explain pods
132+
133+
# Get the documentation of a specific field of a resource
134+
$ kubectl explain pods.spec.containers
135+
136+
.fi
137+
.RE
138+
139+
140+
.SH SEE ALSO
141+
.PP
142+
\fBkubectl(1)\fP,
143+
144+
145+
.SH HISTORY
146+
.PP
147+
January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since!

docs/man/man1/kubectl.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Find more information at
116116

117117
.SH SEE ALSO
118118
.PP
119-
\fBkubectl\-get(1)\fP, \fBkubectl\-describe(1)\fP, \fBkubectl\-create(1)\fP, \fBkubectl\-replace(1)\fP, \fBkubectl\-patch(1)\fP, \fBkubectl\-delete(1)\fP, \fBkubectl\-edit(1)\fP, \fBkubectl\-namespace(1)\fP, \fBkubectl\-logs(1)\fP, \fBkubectl\-rolling\-update(1)\fP, \fBkubectl\-scale(1)\fP, \fBkubectl\-attach(1)\fP, \fBkubectl\-exec(1)\fP, \fBkubectl\-port\-forward(1)\fP, \fBkubectl\-proxy(1)\fP, \fBkubectl\-run(1)\fP, \fBkubectl\-stop(1)\fP, \fBkubectl\-expose(1)\fP, \fBkubectl\-label(1)\fP, \fBkubectl\-annotate(1)\fP, \fBkubectl\-config(1)\fP, \fBkubectl\-cluster\-info(1)\fP, \fBkubectl\-api\-versions(1)\fP, \fBkubectl\-version(1)\fP,
119+
\fBkubectl\-get(1)\fP, \fBkubectl\-describe(1)\fP, \fBkubectl\-create(1)\fP, \fBkubectl\-replace(1)\fP, \fBkubectl\-patch(1)\fP, \fBkubectl\-delete(1)\fP, \fBkubectl\-edit(1)\fP, \fBkubectl\-namespace(1)\fP, \fBkubectl\-logs(1)\fP, \fBkubectl\-rolling\-update(1)\fP, \fBkubectl\-scale(1)\fP, \fBkubectl\-attach(1)\fP, \fBkubectl\-exec(1)\fP, \fBkubectl\-port\-forward(1)\fP, \fBkubectl\-proxy(1)\fP, \fBkubectl\-run(1)\fP, \fBkubectl\-stop(1)\fP, \fBkubectl\-expose(1)\fP, \fBkubectl\-label(1)\fP, \fBkubectl\-annotate(1)\fP, \fBkubectl\-config(1)\fP, \fBkubectl\-cluster\-info(1)\fP, \fBkubectl\-api\-versions(1)\fP, \fBkubectl\-version(1)\fP, \fBkubectl\-explain(1)\fP,
120120

121121

122122
.SH HISTORY

docs/user-guide/kubectl/.files_generated

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ kubectl_delete.md
1616
kubectl_describe.md
1717
kubectl_edit.md
1818
kubectl_exec.md
19+
kubectl_explain.md
1920
kubectl_expose.md
2021
kubectl_get.md
2122
kubectl_label.md

docs/user-guide/kubectl/kubectl.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ kubectl
8686
* [kubectl describe](kubectl_describe.md) - Show details of a specific resource or group of resources
8787
* [kubectl edit](kubectl_edit.md) - Edit a resource on the server
8888
* [kubectl exec](kubectl_exec.md) - Execute a command in a container.
89+
* [kubectl explain](kubectl_explain.md) - Documentation of resources.
8990
* [kubectl expose](kubectl_expose.md) - Take a replication controller, service or pod and expose it as a new Kubernetes Service
9091
* [kubectl get](kubectl_get.md) - Display one or many resources
9192
* [kubectl label](kubectl_label.md) - Update the labels on a resource
@@ -101,7 +102,7 @@ kubectl
101102
* [kubectl stop](kubectl_stop.md) - Deprecated: Gracefully shut down a resource by name or filename.
102103
* [kubectl version](kubectl_version.md) - Print the client and server version information.
103104

104-
###### Auto generated by spf13/cobra at 2015-09-11 06:17:55.670147499 +0000 UTC
105+
###### Auto generated by spf13/cobra at 2015-09-22 11:13:47.6353025 +0000 UTC
105106

106107
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
107108
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl.md?pixel)]()
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->
2+
3+
<!-- BEGIN STRIP_FOR_RELEASE -->
4+
5+
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
6+
width="25" height="25">
7+
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
8+
width="25" height="25">
9+
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
10+
width="25" height="25">
11+
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
12+
width="25" height="25">
13+
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
14+
width="25" height="25">
15+
16+
<h2>PLEASE NOTE: This document applies to the HEAD of the source tree</h2>
17+
18+
If you are using a released version of Kubernetes, you should
19+
refer to the docs that go with that version.
20+
21+
<strong>
22+
The latest 1.0.x release of this document can be found
23+
[here](http://releases.k8s.io/release-1.0/docs/user-guide/kubectl/kubectl_explain.md).
24+
25+
Documentation for other releases can be found at
26+
[releases.k8s.io](http://releases.k8s.io).
27+
</strong>
28+
--
29+
30+
<!-- END STRIP_FOR_RELEASE -->
31+
32+
<!-- END MUNGE: UNVERSIONED_WARNING -->
33+
34+
## kubectl explain
35+
36+
Documentation of resources.
37+
38+
### Synopsis
39+
40+
41+
Documentation of resources.
42+
43+
Possible resource types include: pods (po), services (svc),
44+
replicationcontrollers (rc), nodes (no), events (ev), componentstatuses (cs),
45+
limitranges (limits), persistentvolumes (pv), persistentvolumeclaims (pvc),
46+
resourcequotas (quota), namespaces (ns) or endpoints (ep).
47+
48+
```
49+
kubectl explain RESOURCE
50+
```
51+
52+
### Examples
53+
54+
```
55+
# Get the documentation of the resource and its fields
56+
$ kubectl explain pods
57+
58+
# Get the documentation of a specific field of a resource
59+
$ kubectl explain pods.spec.containers
60+
```
61+
62+
### Options
63+
64+
```
65+
--recursive[=false]: Print the fields of fields (Currently only 1 level deep)
66+
```
67+
68+
### Options inherited from parent commands
69+
70+
```
71+
--alsologtostderr[=false]: log to standard error as well as files
72+
--api-version="": The API version to use when talking to the server
73+
--certificate-authority="": Path to a cert. file for the certificate authority.
74+
--client-certificate="": Path to a client key file for TLS.
75+
--client-key="": Path to a client key file for TLS.
76+
--cluster="": The name of the kubeconfig cluster to use
77+
--context="": The name of the kubeconfig context to use
78+
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
79+
--kubeconfig="": Path to the kubeconfig file to use for CLI requests.
80+
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
81+
--log-dir="": If non-empty, write log files in this directory
82+
--log-flush-frequency=5s: Maximum number of seconds between log flushes
83+
--logtostderr[=true]: log to standard error instead of files
84+
--match-server-version[=false]: Require server version to match client version
85+
--namespace="": If present, the namespace scope for this CLI request.
86+
--password="": Password for basic authentication to the API server.
87+
-s, --server="": The address and port of the Kubernetes API server
88+
--stderrthreshold=2: logs at or above this threshold go to stderr
89+
--token="": Bearer token for authentication to the API server.
90+
--user="": The name of the kubeconfig user to use
91+
--username="": Username for basic authentication to the API server.
92+
--v=0: log level for V logs
93+
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
94+
```
95+
96+
### SEE ALSO
97+
98+
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
99+
100+
###### Auto generated by spf13/cobra at 2015-09-25 11:07:41.758531939 +0000 UTC
101+
102+
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
103+
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_explain.md?pixel)]()
104+
<!-- END MUNGE: GENERATED_ANALYTICS -->

hack/verify-flags/known-flags.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ node-startup-grace-period
190190
node-status-update-frequency
191191
node-sync-period
192192
no-headers
193+
no-suggestions
193194
num-nodes
194195
oidc-ca-file
195196
oidc-client-id

pkg/kubectl/cmd/cmd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ Find more information at https://github.com/kubernetes/kubernetes.`,
172172
cmds.AddCommand(NewCmdClusterInfo(f, out))
173173
cmds.AddCommand(NewCmdApiVersions(f, out))
174174
cmds.AddCommand(NewCmdVersion(f, out))
175+
cmds.AddCommand(NewCmdExplain(f, out))
175176

176177
return cmds
177178
}

0 commit comments

Comments
 (0)