AlexW
AlexW

Reputation: 3399

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"

Upvotes: 2

Views: 2595

Answers (1)

Nataraj Medayhal
Nataraj Medayhal

Reputation: 1221

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

Upvotes: 1

Related Questions