1.1 port-forward

kubectl port-forward allows using resource name, such as a service name, to select a matchineg pod to port forward to

Forward to a pod:

kubectl port-forward redis-master-765d459796-258hz 6379:6379

kubectl port-forward pods/redis-master-765d459796-258hz 6379:6379

Forward to a service:

kubectl port-forward svc/redis-master 6379:6379

After forwarding, you can use redis client at localhost, such as:

redis-cli

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

Tags:
Created by Bin Chen on 2020/09/04 04:05
    

Need help?

If you need help with XWiki you can contact:

京ICP备19054609号-1

京公网安备 11010502039855号