Skip to content

Commit

Permalink
new kubectl explain command
Browse files Browse the repository at this point in the history
  • Loading branch information
andronat committed Sep 26, 2015
1 parent 495433f commit e8b9dde
Show file tree
Hide file tree
Showing 12 changed files with 622 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .generated_docs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ docs/man/man1/kubectl-delete.1
docs/man/man1/kubectl-describe.1
docs/man/man1/kubectl-edit.1
docs/man/man1/kubectl-exec.1
docs/man/man1/kubectl-explain.1
docs/man/man1/kubectl-expose.1
docs/man/man1/kubectl-get.1
docs/man/man1/kubectl-label.1
Expand Down Expand Up @@ -50,6 +51,7 @@ docs/user-guide/kubectl/kubectl_delete.md
docs/user-guide/kubectl/kubectl_describe.md
docs/user-guide/kubectl/kubectl_edit.md
docs/user-guide/kubectl/kubectl_exec.md
docs/user-guide/kubectl/kubectl_explain.md
docs/user-guide/kubectl/kubectl_expose.md
docs/user-guide/kubectl/kubectl_get.md
docs/user-guide/kubectl/kubectl_label.md
Expand Down
17 changes: 17 additions & 0 deletions contrib/completions/bash/kubectl
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,22 @@ _kubectl_version()
must_have_one_noun=()
}

_kubectl_explain()
{
last_command="kubectl_explain"
commands=()

flags=()
two_word_flags=()
flags_with_completion=()
flags_completion=()

flags+=("--recursive")

must_have_one_flag=()
must_have_one_noun=()
}

_kubectl()
{
last_command="kubectl"
Expand Down Expand Up @@ -1133,6 +1149,7 @@ _kubectl()
commands+=("cluster-info")
commands+=("api-versions")
commands+=("version")
commands+=("explain")

flags=()
two_word_flags=()
Expand Down
1 change: 1 addition & 0 deletions docs/man/man1/.files_generated
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ kubectl-delete.1
kubectl-describe.1
kubectl-edit.1
kubectl-exec.1
kubectl-explain.1
kubectl-expose.1
kubectl-get.1
kubectl-label.1
Expand Down
147 changes: 147 additions & 0 deletions docs/man/man1/kubectl-explain.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" ""


.SH NAME
.PP
kubectl explain \- Documentation of resources.


.SH SYNOPSIS
.PP
\fBkubectl explain\fP [OPTIONS]


.SH DESCRIPTION
.PP
Documentation of resources.

.PP
Possible resource types include: pods (po), services (svc),
replicationcontrollers (rc), nodes (no), events (ev), componentstatuses (cs),
limitranges (limits), persistentvolumes (pv), persistentvolumeclaims (pvc),
resourcequotas (quota), namespaces (ns) or endpoints (ep).


.SH OPTIONS
.PP
\fB\-\-recursive\fP=false
Print the fields of fields (Currently only 1 level deep)


.SH OPTIONS INHERITED FROM PARENT COMMANDS
.PP
\fB\-\-alsologtostderr\fP=false
log to standard error as well as files

.PP
\fB\-\-api\-version\fP=""
The API version to use when talking to the server

.PP
\fB\-\-certificate\-authority\fP=""
Path to a cert. file for the certificate authority.

.PP
\fB\-\-client\-certificate\fP=""
Path to a client key file for TLS.

.PP
\fB\-\-client\-key\fP=""
Path to a client key file for TLS.

.PP
\fB\-\-cluster\fP=""
The name of the kubeconfig cluster to use

.PP
\fB\-\-context\fP=""
The name of the kubeconfig context to use

.PP
\fB\-\-insecure\-skip\-tls\-verify\fP=false
If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.

.PP
\fB\-\-kubeconfig\fP=""
Path to the kubeconfig file to use for CLI requests.

.PP
\fB\-\-log\-backtrace\-at\fP=:0
when logging hits line file:N, emit a stack trace

.PP
\fB\-\-log\-dir\fP=""
If non\-empty, write log files in this directory

.PP
\fB\-\-log\-flush\-frequency\fP=5s
Maximum number of seconds between log flushes

.PP
\fB\-\-logtostderr\fP=true
log to standard error instead of files

.PP
\fB\-\-match\-server\-version\fP=false
Require server version to match client version

.PP
\fB\-\-namespace\fP=""
If present, the namespace scope for this CLI request.

.PP
\fB\-\-password\fP=""
Password for basic authentication to the API server.

.PP
\fB\-s\fP, \fB\-\-server\fP=""
The address and port of the Kubernetes API server

.PP
\fB\-\-stderrthreshold\fP=2
logs at or above this threshold go to stderr

.PP
\fB\-\-token\fP=""
Bearer token for authentication to the API server.

.PP
\fB\-\-user\fP=""
The name of the kubeconfig user to use

.PP
\fB\-\-username\fP=""
Username for basic authentication to the API server.

.PP
\fB\-\-v\fP=0
log level for V logs

.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging


.SH EXAMPLE
.PP
.RS

.nf
# Get the documentation of the resource and its fields
$ kubectl explain pods

# Get the documentation of a specific field of a resource
$ kubectl explain pods.spec.containers

.fi
.RE


.SH SEE ALSO
.PP
\fBkubectl(1)\fP,


.SH HISTORY
.PP
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!
2 changes: 1 addition & 1 deletion docs/man/man1/kubectl.1
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Find more information at

.SH SEE ALSO
.PP
\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\-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,


.SH HISTORY
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/kubectl/.files_generated
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ kubectl_delete.md
kubectl_describe.md
kubectl_edit.md
kubectl_exec.md
kubectl_explain.md
kubectl_expose.md
kubectl_get.md
kubectl_label.md
Expand Down
3 changes: 2 additions & 1 deletion docs/user-guide/kubectl/kubectl.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ kubectl
* [kubectl describe](kubectl_describe.md) - Show details of a specific resource or group of resources
* [kubectl edit](kubectl_edit.md) - Edit a resource on the server
* [kubectl exec](kubectl_exec.md) - Execute a command in a container.
* [kubectl explain](kubectl_explain.md) - Documentation of resources.
* [kubectl expose](kubectl_expose.md) - Take a replication controller, service or pod and expose it as a new Kubernetes Service
* [kubectl get](kubectl_get.md) - Display one or many resources
* [kubectl label](kubectl_label.md) - Update the labels on a resource
Expand All @@ -101,7 +102,7 @@ kubectl
* [kubectl stop](kubectl_stop.md) - Deprecated: Gracefully shut down a resource by name or filename.
* [kubectl version](kubectl_version.md) - Print the client and server version information.

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

<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl.md?pixel)]()
Expand Down
104 changes: 104 additions & 0 deletions docs/user-guide/kubectl/kubectl_explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->

<!-- BEGIN STRIP_FOR_RELEASE -->

<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
width="25" height="25">
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
width="25" height="25">
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
width="25" height="25">
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
width="25" height="25">
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
width="25" height="25">

<h2>PLEASE NOTE: This document applies to the HEAD of the source tree</h2>

If you are using a released version of Kubernetes, you should
refer to the docs that go with that version.

<strong>
The latest 1.0.x release of this document can be found
[here](http://releases.k8s.io/release-1.0/docs/user-guide/kubectl/kubectl_explain.md).

Documentation for other releases can be found at
[releases.k8s.io](http://releases.k8s.io).
</strong>
--

<!-- END STRIP_FOR_RELEASE -->

<!-- END MUNGE: UNVERSIONED_WARNING -->

## kubectl explain

Documentation of resources.

### Synopsis


Documentation of resources.

Possible resource types include: pods (po), services (svc),
replicationcontrollers (rc), nodes (no), events (ev), componentstatuses (cs),
limitranges (limits), persistentvolumes (pv), persistentvolumeclaims (pvc),
resourcequotas (quota), namespaces (ns) or endpoints (ep).

```
kubectl explain RESOURCE
```

### Examples

```
# Get the documentation of the resource and its fields
$ kubectl explain pods
# Get the documentation of a specific field of a resource
$ kubectl explain pods.spec.containers
```

### Options

```
--recursive[=false]: Print the fields of fields (Currently only 1 level deep)
```

### Options inherited from parent commands

```
--alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS.
--client-key="": Path to a client key file for TLS.
--cluster="": The name of the kubeconfig cluster to use
--context="": The name of the kubeconfig context to use
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server.
-s, --server="": The address and port of the Kubernetes API server
--stderrthreshold=2: logs at or above this threshold go to stderr
--token="": Bearer token for authentication to the API server.
--user="": The name of the kubeconfig user to use
--username="": Username for basic authentication to the API server.
--v=0: log level for V logs
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
```

### SEE ALSO

* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager

###### Auto generated by spf13/cobra at 2015-09-25 11:07:41.758531939 +0000 UTC

<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_explain.md?pixel)]()
<!-- END MUNGE: GENERATED_ANALYTICS -->
1 change: 1 addition & 0 deletions hack/verify-flags/known-flags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ node-startup-grace-period
node-status-update-frequency
node-sync-period
no-headers
no-suggestions
num-nodes
oidc-ca-file
oidc-client-id
Expand Down
1 change: 1 addition & 0 deletions pkg/kubectl/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ Find more information at https://github.com/kubernetes/kubernetes.`,
cmds.AddCommand(NewCmdClusterInfo(f, out))
cmds.AddCommand(NewCmdApiVersions(f, out))
cmds.AddCommand(NewCmdVersion(f, out))
cmds.AddCommand(NewCmdExplain(f, out))

return cmds
}
Expand Down
Loading

0 comments on commit e8b9dde

Please sign in to comment.