kubernetes/kops · error

failed to build load balancer client: %w

Error message

failed to build load balancer client: %w

What it means

Wraps an error from buildLoadBalancerClient, which creates either an Octavia (NewLoadBalancerV2) or Neutron-lbaas (NewNetworkV2) service client. It means the load-balancer service client could not be constructed for the region, typically because the service endpoint is missing or auth failed.

Source

Thrown at upup/pkg/fi/cloudup/openstack/cloud.go:440

			return nil, fmt.Errorf("error building dns client: %w", err)
		}
	}

	c := &openstackCloud{
		cinderClient:  cinderClient,
		neutronClient: neutronClient,
		novaClient:    novaClient,
		dnsClient:     dnsClient,
		glanceClient:  glanceClient,
		tags:          tags,
		region:        region,
		useOctavia:    false,
	}

	setFloatingIPSupport(c, spec)
	err = buildLoadBalancerClient(c, spec, provider, region)
	if err != nil {
		return nil, fmt.Errorf("failed to build load balancer client: %w", err)
	}
	openstackCloudInstances[region] = c

	return c, nil

}

func setFloatingIPSupport(c *openstackCloud, spec *kops.OpenstackSpec) {
	if spec == nil || spec.Router == nil {
		c.floatingEnabled = false
		klog.V(2).Infof("Floating IP support for OpenStack disabled")
		return
	}

	c.floatingEnabled = true
	c.extNetworkName = spec.Router.ExternalNetwork

	if spec.Router.ExternalSubnet != nil {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Confirm Octavia (service type 'load-balancer') exists in the region: openstack service list / openstack loadbalancer list
  2. Correct the region in the cluster spec so EndpointOpts resolves an endpoint
  3. Fix OpenStack credentials (OS_* env or clouds.yaml) and verify with an LB CLI call
  4. Ensure the project has RBAC access to the load-balancing service

Example fix

// before: spec without octavia in a neutron-lbaas-only cloud
// after: deploy Octavia or set spec.Loadbalancer.UseOctavia = false and ensure neutron lbaasv2 endpoint exists
Defensive patterns

Strategy: validation

Validate before calling

// verify an LB service endpoint exists for the region before building the cluster
endpoints, _ := client.ServiceEndpointDiscovery("load-balancer")
if endpoints == nil { return errors.New("region lacks load-balancer service") }

Try / catch

// go
if err != nil && strings.Contains(err.Error(), "failed to build load balancer client") {
    klog.Errorf("check octavia/neutron lbaas endpoint for region %s", region)
}

Prevention

When it happens

Trigger: kops setFloatingIPSupport/buildLoadBalancerClient call path: openstack.NewLoadBalancerV2 or openstack.NewNetworkV2 fails due to no 'load-balancer' (octavia) or 'network' endpoint in the catalog, bad region, or authentication error.

Common situations: Cluster without Octavia deployed while LB is configured; mistyped region; expired/invalid credentials; service catalog entry missing for the project.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/6a27b4d47e5fafff. Report an issue: GitHub.