kubectl forward

2020-11-19  本文已影响0人  allenhaozi

Forward a local port to a port on the Pod

  1. kubectl port-forward allows using resource name, such as a pod name, to select a matching pod to port forward to.
    # Change redis-master-765d459796-258hz to the name of the Pod
    kubectl port-forward redis-master-765d459796-258hz 7000:6379
    
    which is the same as
    kubectl port-forward pods/redis-master-765d459796-258hz 7000:6379
    
    or
    kubectl port-forward deployment/redis-master 7000:6379
    
    or
    kubectl port-forward replicaset/redis-master 7000:6379
    
    
    or
    kubectl port-forward service/redis-master 7000:redis
    

https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/

上一篇下一篇

猜你喜欢

热点阅读