Merge pull request #11138 from feihujiang/portForwardWithoutP

kubectl port-forward accept a pod without -p
This commit is contained in:
Alex Robinson
2015-08-10 13:29:14 -07:00
7 changed files with 89 additions and 22 deletions

View File

@@ -100,7 +100,7 @@ kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-05 23:27:50.885807613 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-07 09:20:43.877286912 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_patch.md?pixel)]()

View File

@@ -41,7 +41,7 @@ Forward one or more local ports to a pod.
Forward one or more local ports to a pod.
```
kubectl port-forward -p POD_NAME [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N]
kubectl port-forward POD [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N]
```
### Examples
@@ -49,16 +49,16 @@ kubectl port-forward -p POD_NAME [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REM
```
// listens on ports 5000 and 6000 locally, forwarding data to/from ports 5000 and 6000 in the pod
$ kubectl port-forward -p mypod 5000 6000
$ kubectl port-forward mypod 5000 6000
// listens on port 8888 locally, forwarding to 5000 in the pod
$ kubectl port-forward -p mypod 8888:5000
$ kubectl port-forward mypod 8888:5000
// listens on a random port locally, forwarding to 5000 in the pod
$ kubectl port-forward -p mypod :5000
$ kubectl port-forward mypod :5000
// listens on a random port locally, forwarding to 5000 in the pod
$ kubectl port-forward -p mypod 0:5000
$ kubectl port-forward mypod 0:5000
```
### Options
@@ -101,7 +101,7 @@ $ kubectl port-forward -p mypod 0:5000
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-05 14:22:30.874544642 +0000 UTC
###### Auto generated by spf13/cobra at 2015-08-07 09:20:43.879885036 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_port-forward.md?pixel)]()