{"record":{"id":"94ed817f3886314e","repo":"kubernetes/kops","slug":"did-not-find-floatingsubnet-for-lb","errorCode":null,"errorMessage":"did not find floatingsubnet for LB","messagePattern":"did not find floatingsubnet for LB","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstack/subnet.go","lineNumber":170,"sourceCode":"\treturn getLBFloatingSubnet(c, c.floatingSubnet)\n}\n\nfunc getLBFloatingSubnet(c OpenstackCloud, floatingSubnet *string) (subnet *subnets.Subnet, err error) {\n\tif floatingSubnet == nil {\n\t\treturn nil, nil\n\t}\n\n\tsubnets, err := c.ListSubnets(subnets.ListOpts{\n\t\tName: fi.ValueOf(floatingSubnet),\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(subnets) == 1 {\n\t\treturn &subnets[0], nil\n\t}\n\treturn nil, fmt.Errorf(\"did not find floatingsubnet for LB\")\n}\n","sourceCodeStart":152,"sourceCodeEnd":172,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstack/subnet.go#L152-L172","documentation":"getLBFloatingSubnet resolves the dedicated floating subnet used for load balancer VIPs. Like getExternalSubnet it requires exactly one matching subnet; otherwise it returns \"did not find floatingsubnet for LB\". The candidate set comes from the cluster's configured floatingSubnet filter.","triggerScenarios":"The LB floating subnet filter in cluster config matches zero or multiple subnets in the external network, so len(subnets) != 1.","commonSituations":"Misconfigured or missing `spec.network.floatingSubnet` in the cluster spec, renamed/deleted LB subnet in OpenStack, or a filter that now matches several subnets after network changes.","solutions":["Set spec.network.floatingSubnet (id, name, tag, or cidr) in the cluster spec to uniquely identify one subnet","Verify with `openstack subnet list` that the configured filter matches exactly one subnet","Re-create the LB floating subnet if it was deleted","Re-run kops after correcting the spec"],"exampleFix":"// before\nspec:\n  network:\n    externalNetwork: public\n// after: uniquely identify the LB floating subnet\nspec:\n  network:\n    externalNetwork: public\n    floatingSubnet:\n      name: lb-float-subnet","handlingStrategy":"validation","validationCode":"// Ensure the configured floatingSubnet filter matches exactly one subnet\nmatches := filterSubnets(allSubnets, cfg.FloatingSubnet)\nif len(matches) != 1 {\n\tlog.Fatalf(\"floatingSubnet config matched %d subnets, need exactly 1\", len(matches))\n}","typeGuard":null,"tryCatchPattern":"sub, err := GetLBFloatingSubnet(cloud)\nif err != nil {\n\tif strings.Contains(err.Error(), \"did not find floatingsubnet for LB\") {\n\t\t// correct spec.network.floatingSubnet and retry\n\t}\n\treturn err\n}","preventionTips":["Set spec.network.floatingSubnet with a unique name/tag/id","Check `openstack subnet list` after network changes to keep the filter unique","Do not delete or rename the LB floating subnet while the cluster exists","Review cluster spec networking fields before upgrades"],"tags":["openstack","neutron","loadbalancer","subnet","config"],"backgroundTag":"ambiguous-subnet-config","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}