mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-18 21:19:03 +00:00
kubectl port-forward accept a pod without -p
This commit is contained in:
@@ -131,16 +131,16 @@ Forward one or more local ports to a pod.
|
||||
.nf
|
||||
|
||||
// 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
|
||||
|
||||
.fi
|
||||
.RE
|
||||
|
Reference in New Issue
Block a user