Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL2 does not pass through kubectl port-forwards transparently like WSL1 #4406

Closed
andrewgill-dev opened this issue Aug 13, 2019 · 1 comment

Comments

@andrewgill-dev
Copy link

  • Your Windows build number: (Type ver at a Windows Command Prompt)
    Microsoft Windows [Version 10.0.18956.1000]

  • What you're doing and what's happening:
    kubectl port-forward does not allow windows applications to connect as expected over the specified localhost ports on WS2. This behaviour is a change from WSL1.

I am attempting to connect to a dev kubenetes cluster hosted on gcloud. My WSL2 is setup and able to run kubectl commands as expected. e.g. kubectl -n dev get po returns all of the PODs in the namespace as expected.

However, port-forwarding does not allow windows based applications to connect through localhost as expected.

I run the following command:
kubectl -dev port-forward postgresdb 5432

It responds with:
Forwarding from 127.0.0.1:5432 -> 5432
Forwarding from [::1]:5432 -> 5432

However, when windows attempts to connect over 127.0.0.1:5432 the connection fails to work. Running the same command in a powershell console allows the port-forward to work as expected.

  • What's wrong / what should be happening instead:
    I expect the network traffic to pass through to the kubectl cluster as it did in WSL1.
@therealkenc
Copy link
Collaborator

#4199

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants