Metallb: layer2 mode will use NodePort?

Created on 16 Oct 2018  路  4Comments  路  Source: metallb/metallb

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
question

Most helpful comment

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.

All 4 comments

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.

@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?

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.

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

Was this page helpful?
0 / 5 - 0 ratings