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

NodePort services are not accessible from host using localhost #2489

Closed
Noksa opened this issue Jul 6, 2022 · 11 comments
Closed

NodePort services are not accessible from host using localhost #2489

Noksa opened this issue Jul 6, 2022 · 11 comments
Labels
kind/bug Something isn't working
Milestone

Comments

@Noksa
Copy link

Noksa commented Jul 6, 2022

Actual Behavior

Trying to hit a nodeport service from the host using localhost:NODEPORT_SEVICE_PORT
Result:

❯ ~ curl localhost:55457
curl: (7) Failed to connect to localhost port 55457 after 6 ms: Connection refused

Steps to Reproduce

  • Install Rancher Desktop 1.4.1 on Mac M1
  • Use dockerd as CR
  • Allow sudo access
  • Restart Rancher Desktop
  • Create a deployment and create nodeport service mapped to the deployment
  • Try to hit the nodeport using localhost

Result

❯ ~ curl localhost:55457
curl: (7) Failed to connect to localhost port 55457 after 6 ms: Connection refused

Expected Behavior

It should be accessible from the host using localhost as it works in DD for example.

Additional Information

No response

Rancher Desktop Version

1.4.1

Rancher Desktop K8s Version

1.22.11

Which container runtime are you using?

moby (docker cli)

What operating system are you using?

macOS

Operating System / Build Version

MacOS Monterey 12.4

What CPU architecture are you using?

arm64 (Apple Silicon)

Linux only: what package format did you use to install Rancher Desktop?

No response

Windows User Only

No response

@Noksa Noksa added the kind/bug Something isn't working label Jul 6, 2022
@julianbartel
Copy link

I experience the same on Windows 10.0.19044.

  • Rancher Desktop 1.4.1
  • k8s 1.22 and 1.23
  • containerd

@ernestorocha
Copy link

I'm having the exact problem on the same configuration.

But if I come to this menu and click on Forward and use that port instead, I can access the service normally.

image

@jandubois
Copy link
Member

The issue turns out to be an upstream change in Kubernetes itself. You can get the list of versions that don't forward the port properly anymore from #2593 (comment).

So #2593 is actually a duplicate of this one, but we'll keep both open for now because the other issue has more details about the problem already.

@itsnagaraj
Copy link

Kubernetes version 1.19.x and 1.20.x seem to work fine but I couldn't get it working for 1.21.x

@bharathkarnam
Copy link

Same here, doesn’t work for 1.21.x on my Mac M1 chip

@sonia-rattan
Copy link

Same here. So upvoting.

@jandubois
Copy link
Member

Please report the exact configuration you are testing and not make some generalization like "Doesn't work on 1.21.x" if you only tested a specific version, and not all of them.

I assume you only tested 1.21.12, as 1.21.11 and 1.21.10 worked in my testing.

I'm going to close this as a duplicate of #2593.

Feel free to re-open if it fails for you for any version not yet listed in #2593 (comment) (I just updated it to include 1.21.12) and please specify the exact configuration that you are running.

@jandubois
Copy link
Member

Apologies to @Noksa as this is actually the first bug report about this issue, but we didn't realize until recently that #2593 is the same thing. Normally I would close the later issue as a duplicate of the earlier one, but in this case the information about the root cause is already included in the other issue, so we need to keep that one open for the developer who is going to fix it..

We will make a 1.5.1 release next month that will add support for automatic port forwarding with the newer Kubernetes releases; it has not yet been addressed in the 1.5.0 release from earlier today.

@jandubois jandubois added this to the Patch milestone Jul 28, 2022
@itsnagaraj
Copy link

itsnagaraj commented Jul 28, 2022

Please report the exact configuration you are testing and not make some generalization like "Doesn't work on 1.21.x" if you only tested a specific version, and not all of them.

I assume you only tested 1.21.12, as 1.21.11 and 1.21.10 worked in my testing.

I'm going to close this as a duplicate of #2593.

Feel free to re-open if it fails for you for any version not yet listed in #2593 (comment) (I just updated it to include 1.21.12) and please specify the exact configuration that you are running.

Yes I only tried 1.21.12 as that was the EKS version we were using. When node port did not work I switched to 1.20.15 as that was in recommend list. I can confirm that 1.21.11 is working on M1 and I have switched to this version

@jandubois
Copy link
Member

Yes I only tried 1.21.12 as that was the EKS version we were using. When node port did not work I switched to 1.20.15 as that was in recommend list. I can confirm that 1.21.11 is working on M1 and I have switched to this version

@itsnagaraj Thank you for confirming! And sorry I was a bit grumpy last night about the 1.21.x issue!

@davidwincent
Copy link

Is it suposed to work on kubernetes v1.27.2? I am still having problems with port-forward to kube-dns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants