kubernetes/kops · error

cluster configured to use octavia, but router was not config

Error message

cluster configured to use octavia, but router was not configured

What it means

kOps requires a Neutron router (with floating network/subnet) to be configured whenever Octavia load balancing is enabled, because Octavia members need floating IPs for connectivity. This error is returned when UseOctavia is true but the Loadbalancer router configuration (FloatingNetwork) is absent.

Source

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

			spec.Loadbalancer.FloatingNetwork != nil {
			// This field is derived
			lbNet, err := c.ListNetworks(networks.ListOpts{
				Name: fi.ValueOf(spec.Loadbalancer.FloatingNetwork),
			})
			if err != nil || len(lbNet) != 1 {
				return fmt.Errorf("could not establish floating network id")
			}
			spec.Loadbalancer.FloatingNetworkID = new(lbNet[0].ID)
		}

		if spec.Loadbalancer.UseOctavia != nil {
			octavia = fi.ValueOf(spec.Loadbalancer.UseOctavia)
		}
		if spec.Loadbalancer.FloatingSubnet != nil {
			c.floatingSubnet = spec.Loadbalancer.FloatingSubnet
		}
	} else if fi.ValueOf(spec.Loadbalancer.UseOctavia) {
		return fmt.Errorf("cluster configured to use octavia, but router was not configured")
	}
	c.useOctavia = octavia

	var lbClient *gophercloud.ServiceClient
	if octavia {
		klog.V(2).Infof("Openstack using Octavia lbaasv2 api")
		client, err := openstack.NewLoadBalancerV2(provider, gophercloud.EndpointOpts{
			Region: region,
		})
		if err != nil {
			return fmt.Errorf("error building lb client: %w", err)
		}
		lbClient = client
	} else {
		klog.V(2).Infof("Openstack using deprecated lbaasv2 api")
		client, err := openstack.NewNetworkV2(provider, gophercloud.EndpointOpts{
			Region: region,
		})

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Add spec.Loadbalancer.FloatingNetwork (or FloatingNetworkID) to the cluster spec so the router/floating network is configured
  2. Verify the named floating network exists (see 'openstack network list --external')
  3. Alternatively disable octavia (UseOctavia=false) if no router is desired, accepting deprecated lbaasv2

Example fix

// before
loadBalancer: { useOctavia: true }
// after
loadBalancer: { useOctavia: true, floatingNetwork: "public-network-1" }
Defensive patterns

Strategy: validation

Validate before calling

// validate spec before apply
if fi.ValueOf(spec.Loadbalancer.UseOctavia) && spec.Loadbalancer.FloatingNetwork == nil && spec.Loadbalancer.FloatingNetworkID == nil {
    return errors.New("octavia requires Loadbalancer.FloatingNetwork(ID) to be set")
}

Try / catch

// go
if err != nil && strings.Contains(err.Error(), "router was not configured") {
    return fmt.Errorf("add loadBalancer.floatingNetwork to the cluster spec")
}

Prevention

When it happens

Trigger: spec.Loadbalancer.UseOctavia = true while the outer condition (router config present, i.e. Loadbalancer.FloatingNetwork/FloatingNetworkID set) is false — i.e. octavia requested with no floating network configured.

Common situations: Cluster spec migrated to octavia without adding the floating network block; spec authored by hand or by an old tool version that omitted router settings; users assuming octavia works router-less.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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