Forward a local port to a port on the Pod
-
kubectl port-forward
allows using resource name, such as a pod name, to select a matching pod to port forward to.
which is the same as# Change redis-master-765d459796-258hz to the name of the Pod kubectl port-forward redis-master-765d459796-258hz 7000:6379
orkubectl port-forward pods/redis-master-765d459796-258hz 7000:6379
orkubectl port-forward deployment/redis-master 7000:6379
orkubectl port-forward replicaset/redis-master 7000:6379
kubectl port-forward service/redis-master 7000:redis
https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/
网友评论