Kubectrl
Last modified by Bin Chen on 2020/09/04 04:05
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/