superbrothers/kubectl-open-svc-plugin

Fails to start service on WSL2

Closed this issue · 2 comments

I'm on WSL2 Ubuntu and I'd like to use this awesome plugin, but I get the following error and unfortunately I cannot use the endpoint.

$ kubectl open-svc sample-service
Starting to serve on 127.0.0.1:8001
Opening service/sample-service in the default browser...
Error: Failed to open http://127.0.0.1:8001/api/v1/namespaces/default/services/sample-service:nginx/proxy in the default browser

I assume because you cannot use "default browser" on WSL2 it returns error.
Is there possibility you might implement non-GUI support? I assume this happens for headless Linux too.

What kind of behavior do you expect?

At this time, you can use the following steps to open the service URL:

$ kubectl proxy --port=8001
$ curl $(kubectl open-svc sample-service --url)

In WSL2, there doesn't seem to be a command equivalent to Linux xdg-open. (And I don't have a WSL2 environment).

I will close this issue once. If anyone needs support, please comment.