简体   繁体   中英

How can I Port Forward to an istio VirtualService?

I have setup VirtualService and ServiceEntry for a few services outside my kubernetes cluster.
My apps can access them without any issue.
I was wondering if it would be somehow possible to perform a port-forward to these services via kubectl , similar to how you would port-forward into a pod or a service.

This works:
kubectl port-forward service/my-service 8080:80

This Doesn't:
kubectl port-forward vs/my-virtual-service 6379:6379

I get:

error: no kind "VirtualService" is registered for version "networking.istio.io/v1beta1" in scheme "k8s.io/client-go/kubernetes/scheme/register.go:72"

Port forwarding can be done to istio-ingressgateway service but not to virtual service. More details of service and virtual service of istio are in their official documentation

One more option is to change istio-ingressgateway service to NodePort

kubectl edit svc istio-ingressgateway -n istio-system

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM