Kubectl get command accepts a filename param

This commit is contained in:
feihujiang
2015-08-10 19:02:14 +08:00
parent a6148e79c3
commit 18a1400928
6 changed files with 107 additions and 9 deletions

View File

@@ -31,6 +31,10 @@ of the \-\-template flag, you can filter the attributes of the fetched resource(
\fB\-\-all\-namespaces\fP=false
If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with \-\-namespace.
.PP
\fB\-f\fP, \fB\-\-filename\fP=[]
Filename, directory, or URL to a file identifying the resource to get from a server.
.PP
\fB\-h\fP, \fB\-\-help\fP=false
help for get
@@ -188,6 +192,9 @@ $ kubectl get replicationcontroller web
# List a single pod in JSON output format.
$ kubectl get \-o json pod web\-pod\-13je7
# List a pod identified by type and name specified in "pod.yaml" in JSON output format.
$ kubectl get \-f pod.yaml \-o json
# Return only the phase value of the specified pod.
$ kubectl get \-o template web\-pod\-13je7 \-\-template={{.status.phase}} \-\-api\-version=v1

View File

@@ -67,6 +67,9 @@ $ kubectl get replicationcontroller web
# List a single pod in JSON output format.
$ kubectl get -o json pod web-pod-13je7
# List a pod identified by type and name specified in "pod.yaml" in JSON output format.
$ kubectl get -f pod.yaml -o json
# Return only the phase value of the specified pod.
$ kubectl get -o template web-pod-13je7 --template={{.status.phase}} --api-version=v1
@@ -81,6 +84,7 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7
```
--all-namespaces[=false]: If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
-f, --filename=[]: Filename, directory, or URL to a file identifying the resource to get from a server.
-h, --help[=false]: help for get
-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 statements like -L label1 -L label2...
--no-headers[=false]: When using the default output, don't print headers.
@@ -126,7 +130,7 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-12 23:41:01.301023165 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-13 06:12:05.386038784 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_get.md?pixel)]()