Fix minor bugs in kubectl command

This commit is contained in:
feihujiang 2015-09-28 13:58:31 +08:00
parent ae81f0b55f
commit e31bc89232
9 changed files with 15 additions and 15 deletions

View File

@ -19,7 +19,7 @@ Attach to a a process that is already running inside an existing container.
.SH OPTIONS
.PP
\fB\-c\fP, \fB\-\-container\fP=""
Container name
Container name. If omitted, the first container in the pod will be chosen
.PP
\fB\-i\fP, \fB\-\-stdin\fP=false
@ -135,7 +135,7 @@ $ kubectl attach 123456\-7890
# Get output from ruby\-container from pod 123456\-7890
$ kubectl attach 123456\-7890 \-c ruby\-container date
# Switch to raw terminal mode, sends stdin to 'bash' in ruby\-container from pod 123456\-780
# Switch to raw terminal mode, sends stdin to 'bash' in ruby\-container from pod 123456\-7890
# and sends stdout/stderr from 'bash' back to the client
$ kubectl attach 123456\-7890 \-c ruby\-container \-i \-t

View File

@ -139,7 +139,7 @@ $ kubectl exec 123456\-7890 date
# Get output from running 'date' in ruby\-container from pod 123456\-7890
$ kubectl exec 123456\-7890 \-c ruby\-container date
# Switch to raw terminal mode, sends stdin to 'bash' in ruby\-container from pod 123456\-780
# Switch to raw terminal mode, sends stdin to 'bash' in ruby\-container from pod 123456\-7890
# and sends stdout/stderr from 'bash' back to the client
$ kubectl exec 123456\-7890 \-c ruby\-container \-i \-t \-\- bash \-il

View File

@ -216,7 +216,7 @@ $ kubectl run nginx \-\-image=nginx
$ kubectl run hazelcast \-\-image=hazelcast \-\-port=5701
# Start a single instance of hazelcast and set environment variables "DNS\_DOMAIN=cluster" and "POD\_NAMESPACE=default" in the container.
$ kubectl run hazelcast \-\-image=hazelcast \-\-env="DNS\_DOMAIN=local" \-\-env="POD\_NAMESPACE=default"
$ kubectl run hazelcast \-\-image=hazelcast \-\-env="DNS\_DOMAIN=cluster" \-\-env="POD\_NAMESPACE=default"
# Start a replicated instance of nginx.
$ kubectl run nginx \-\-image=nginx \-\-replicas=5

View File

@ -53,7 +53,7 @@ $ kubectl attach 123456-7890
# Get output from ruby-container from pod 123456-7890
$ kubectl attach 123456-7890 -c ruby-container date
# Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod 123456-780
# Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod 123456-7890
# and sends stdout/stderr from 'bash' back to the client
$ kubectl attach 123456-7890 -c ruby-container -i -t
```
@ -61,7 +61,7 @@ $ kubectl attach 123456-7890 -c ruby-container -i -t
### Options
```
-c, --container="": Container name
-c, --container="": Container name. If omitted, the first container in the pod will be chosen
-i, --stdin[=false]: Pass stdin to the container
-t, --tty[=false]: Stdin is a TTY
```
@ -98,7 +98,7 @@ $ kubectl attach 123456-7890 -c ruby-container -i -t
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-09-10 18:53:03.155651469 +0000 UTC
###### Auto generated by spf13/cobra at 2015-09-28 05:58:08.934629688 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_attach.md?pixel)]()

View File

@ -53,7 +53,7 @@ $ kubectl exec 123456-7890 date
# Get output from running 'date' in ruby-container from pod 123456-7890
$ kubectl exec 123456-7890 -c ruby-container date
# Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod 123456-780
# Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod 123456-7890
# and sends stdout/stderr from 'bash' back to the client
$ kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il
```
@ -99,7 +99,7 @@ $ kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-09-10 18:53:03.156052759 +0000 UTC
###### Auto generated by spf13/cobra at 2015-09-28 05:58:08.934818621 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_exec.md?pixel)]()

View File

@ -55,7 +55,7 @@ $ kubectl run nginx --image=nginx
$ kubectl run hazelcast --image=hazelcast --port=5701
# Start a single instance of hazelcast and set environment variables "DNS_DOMAIN=cluster" and "POD_NAMESPACE=default" in the container.
$ kubectl run hazelcast --image=hazelcast --env="DNS_DOMAIN=local" --env="POD_NAMESPACE=default"
$ kubectl run hazelcast --image=hazelcast --env="DNS_DOMAIN=cluster" --env="POD_NAMESPACE=default"
# Start a replicated instance of nginx.
$ kubectl run nginx --image=nginx --replicas=5
@ -135,7 +135,7 @@ $ kubectl run nginx --image=nginx --command -- <cmd> <arg1> ... <argN>
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-09-10 18:53:03.15783835 +0000 UTC
###### Auto generated by spf13/cobra at 2015-09-28 05:58:08.93540785 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_run.md?pixel)]()

View File

@ -39,7 +39,7 @@ $ kubectl attach 123456-7890
# Get output from ruby-container from pod 123456-7890
$ kubectl attach 123456-7890 -c ruby-container date
# Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod 123456-780
# Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod 123456-7890
# and sends stdout/stderr from 'bash' back to the client
$ kubectl attach 123456-7890 -c ruby-container -i -t`
)
@ -64,7 +64,7 @@ func NewCmdAttach(f *cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer)
},
}
// TODO support UID
cmd.Flags().StringVarP(&options.ContainerName, "container", "c", "", "Container name")
cmd.Flags().StringVarP(&options.ContainerName, "container", "c", "", "Container name. If omitted, the first container in the pod will be chosen")
cmd.Flags().BoolVarP(&options.Stdin, "stdin", "i", false, "Pass stdin to the container")
cmd.Flags().BoolVarP(&options.TTY, "tty", "t", false, "Stdin is a TTY")
return cmd

View File

@ -39,7 +39,7 @@ $ kubectl exec 123456-7890 date
# Get output from running 'date' in ruby-container from pod 123456-7890
$ kubectl exec 123456-7890 -c ruby-container date
# Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod 123456-780
# Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod 123456-7890
# and sends stdout/stderr from 'bash' back to the client
$ kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il`
)

View File

@ -42,7 +42,7 @@ $ kubectl run nginx --image=nginx
$ kubectl run hazelcast --image=hazelcast --port=5701
# Start a single instance of hazelcast and set environment variables "DNS_DOMAIN=cluster" and "POD_NAMESPACE=default" in the container.
$ kubectl run hazelcast --image=hazelcast --env="DNS_DOMAIN=local" --env="POD_NAMESPACE=default"
$ kubectl run hazelcast --image=hazelcast --env="DNS_DOMAIN=cluster" --env="POD_NAMESPACE=default"
# Start a replicated instance of nginx.
$ kubectl run nginx --image=nginx --replicas=5