美文网首页
kubectl forward

kubectl forward

作者: allenhaozi | 来源:发表于2020-11-19 16:00 被阅读0次

    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/

    相关文章

      网友评论

          本文标题:kubectl forward

          本文链接:https://www.haomeiwen.com/subject/xykliktx.html