LoadBalancer stuck pending

I’m running rancher 2.3.1 and trying to create a LoadBalancer service for an application and it’s just stuck in pending state. I can’t see anything in any logs or see why it’s just pending.

I’m a total noob when it comes to load balancing and ingress and etc… Probably didn’t set something up but can’t find it.

service/my-service LoadBalancer 10.43.3.59 7443:31923/TCP 2m41s

Thanks for any help.

are you running this on-prem, or in a public cloud?

There is no load balancer on-prem - it requires public cloud

are you running this on-prem, or in a public cloud?

There is no load balancer on-prem - it requires public cloud

So how do you access an app on a bare metal server, may I ask ?

Install MetalLB. Works like a charm for non-cloud Kubernetes.
https://metallb.universe.tf/

Hi Steve, thanks for your reply. Is it possible to make MetalLB route requests according to the request host ? Eg, can it route requests on Port 82 (say) on a single IP to different workloads/namespaces according to whether the request was originally made to mydomain1.com or mydomain2.com etc ?

Thanks again,

No; “Request Host” is a layer 7 / http concept; an ingress controller can route requests based on the Host header because the client sends the hostname it wants in the request payload and the ingress controller can parse that out before directing the request.

For load balancers / arbitrary layer 4 protocols there is no “Host header” (or headers in general). The client looks up the requested name in DNS and gets back an IP, then connects to that IP. The server has no idea what name (if any) the client decided to resolve before connecting to its IP.

No, MetalLB only addresses layer 3: it gives any container who requests it an IP address. I’d advise using Traefik along with MetalLB. You point your routing to the IP given to Traefik by MetalLB, and Traefik understands the host headers, supplies LetsEncrypt integration and routes traffic into the containers inside Kubernetes.

for layer 7 traffic (HTTP/S) the built in ingress controller does a fine job. But that does not give you load balancing into the cluster. For an on-prem install, you need to use an external load balancer. We have had good luck using NSX and Citrix ADC. No issues with either.