[RHOCP 4] MetalLB does not assign IP Address to Service of type LoadBalancer

Solution Verified - Updated -

Issue

  • Is there a way to configure MetalLB in a way that it should only allocate IP addresses to specific services, and restrict allocation of IP addresses from the MetalLB IP address pool for any other service?
  • How to restrict services of type LoadBalancer (newly created or existing one) to not allocate an IP address from the MetalLB IP address pool?
  • When creating a service of type LoadBalancer, ExternalIP shows pending state, and MetalLB controller pod logs show no available IPs in pool

    $ oc get svc -n kuard
    
    NAME           TYPE           CLUSTER-IP       EXTERNAL-IP    PORT(S)          AGE
    kuard          LoadBalancer   172.xx.xx.xx    10.xx.xx.xxx   80:32321/TCP     8d
    kuard-blue     LoadBalancer   172.xx.xx.xxx   10.xx.xx.xxx   8080:32325/TCP   8d
    kuard-green    LoadBalancer   172.xx.xx.xx    <pending>      8080:30700/TCP   8d
    kuard-purple   ClusterIP      172.xx.xx.xx    <none>         8080/TCP         8d
    
    $ oc logs controller-xxxx-xxx -c controller -n metallb-system
    
    {"caller":"service_controller.go:60","controller":"ServiceReconciler","level":"info","start reconcile":"kuard/kuard-green","ts":"2023-01-19T15:59:40Z"}
    {"caller":"service.go:140","error":"no available IPs in pool \"metallb-pool\" for ipv4 IPFamily","level":"error","msg":"IP allocation failed","op":"allocateIPs","ts":"2023-01-19T15:59:40Z"}
    {"caller":"service_controller.go:103","controller":"ServiceReconciler","end reconcile":"kuard/kuard-green","level":"info","ts":"2023-01-19T15:59:40Z"}
    
    

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content