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

layer2 mode will use NodePort? #328

Closed
whybeyoung opened this issue Oct 16, 2018 · 4 comments
Closed

layer2 mode will use NodePort? #328

whybeyoung opened this issue Oct 16, 2018 · 4 comments
Labels

Comments

@whybeyoung
Copy link

whybeyoung commented Oct 16, 2018

Is this a bug report or a feature request?:

bug

What happened:

when i install the metalb, and then specify the service type to LoadBalancer,
then it will give me a exteranl_ip correctly, and it works.

but I find that the service will automactilly allocated a nodePort, why this happened?

What you expected to happen:

nodePort should not be allocated and used.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • MetalLB version: latest
  • Kubernetes version: 1.11.1
  • BGP router type/version: layer2
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a): ubuntu16.04 standard 4.4 kernel
@danderson
Copy link
Contributor

Kubernetes does this automatically, there is no choice. The three service types (ClusterIP, NodePort, LoadBalancer) are supersets of each other. A NodePort service also has an internal cluster IP. A LoadBalancer service also has a NodePort and an internal cluster IP.

This is part of the core k8s service logic, MetalLB can't change it even though it doesn't care about the NodePort.

@whybeyoung
Copy link
Author

@danderson how about that if i use the bgp mode, if LoadBalancer must have nodePort, oh that's awful,
cluster all node will use the same nodePort, is that means that the lodabalancer service number if limited by the nodePort numbers. it's awful, is other lb do the same things?

@danderson
Copy link
Contributor

Yes, all k8s LoadBalancer services do this. All MetalLB modes, and all cloud implementations, etc. It's built into the core k8s logic for services, no way to turn it off. Yes, it means the number of LBs is limited by the number of available NodePorts, by default 2767.

Sorry, there's nothing I can do to improve this. If this is a problem for you, you should report a bug in upstream Kubernetes and explain why this breaks your use case. Hopefully that will encourage k8s devs to remove the requirement that LoadBalancer has a NodePort.

@whybeyoung
Copy link
Author

@danderson thanks to explain that , i will try to report this in the upstream. thanks a lot .

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

No branches or pull requests

2 participants