kubernetes/kops · error
error creating loadbalancer: %v
Error message
error creating loadbalancer: %v
What it means
Within createLB, loadbalancers.Create is retried via vfs.RetryWithBackoff; every failure from the Octavia API is wrapped as 'error creating loadbalancer: %v' and retried until writeBackoff gives up. The message carries the underlying API error (validation, quota, conflict, outage).
Source
Thrown at upup/pkg/fi/cloudup/openstack/loadbalancer.go:221
} else {
return wait.ErrWaitTimeout
}
}
func (c *openstackCloud) CreateLB(opt loadbalancers.CreateOptsBuilder) (*loadbalancers.LoadBalancer, error) {
return createLB(c, opt)
}
func createLB(c OpenstackCloud, opt loadbalancers.CreateOptsBuilder) (*loadbalancers.LoadBalancer, error) {
if c.LoadBalancerClient() == nil {
return nil, fmt.Errorf("loadbalancer support not available in this deployment")
}
var i *loadbalancers.LoadBalancer
done, err := vfs.RetryWithBackoff(writeBackoff, func() (bool, error) {
v, err := loadbalancers.Create(context.TODO(), c.LoadBalancerClient(), opt).Extract()
if err != nil {
return false, fmt.Errorf("error creating loadbalancer: %v", err)
}
i = v
return true, nil
})
if err != nil {
return i, err
} else if done {
return i, nil
} else {
return i, wait.ErrWaitTimeout
}
}
func (c *openstackCloud) GetLB(loadbalancerID string) (lb *loadbalancers.LoadBalancer, err error) {
return getLB(c, loadbalancerID)
}
func getLB(c OpenstackCloud, loadbalancerID string) (lb *loadbalancers.LoadBalancer, err error) {View on GitHub (pinned to 4c8573c808)
Solutions
- Read the wrapped error: 403/quota — raise the project's loadbalancer quota; 404 — fix vip subnet/network IDs in the spec
- Validate CreateOpts against the deployed Octavia version (flavor, provider, vip_subnet_id) and correct the cluster spec
- Check Octavia service health (amphora capacity, API logs) if errors are 5xx and retry
- Confirm the configured project/network can host the VIP and has ports available
- Retry the operation after transient failures — backoff is already applied, so persistence implies a config/quota issue
Defensive patterns
Strategy: retry
Validate before calling
// pre-validate CreateOpts against the environment
if opt.GetVipSubnetID() == "" { return fmt.Errorf("vip_subnet_id is required") }
if flavorID != "" {
if _, err := flavors.Get(context.TODO(), client, flavorID).Extract(); err != nil {
return fmt.Errorf("flavor %s does not exist in this Octavia", flavorID)
}
}
// also check quota: os_quota.versions loadbalancer limit Try / catch
done, err := vfs.RetryWithBackoff(writeBackoff, func() (bool, error) {
v, err := loadbalancers.Create(context.TODO(), client, opt).Extract()
if err != nil {
var gerr gophercloud.ErrUnexpectedResponseCode
if errors.As(err, &gerr) && (gerr.Actual == 403 || gerr.Actual == 404) {
return false, err // config/quota problem: do not blind-retry
}
return false, fmt.Errorf("error creating loadbalancer: %v", err) // transient: retry
}
return true, nil
}) Prevention
- Raise loadbalancer quotas before large rollouts
- Validate subnet/network/flavor IDs in the cluster spec against the live environment
- Keep Octavia capacity (amphora) monitored; 5xx often means provider shortage
- Distinguish permanent (403/404) from transient failures in retry logic
When it happens
Trigger: Octavia create rejected: invalid CreateOpts (bad vip_subnet_id/flavor), quota exceeded for loadbalancers, subnet/vip not found, 409 on provisioning status, or API 5xx during service provisioning for a LoadBalancer-type Kubernetes service.
Common situations: Kubernetes service of type LoadBalancer stuck Pending because Octavia quota (loadbalancer count) is exhausted; wrong subnet/network in the cluster spec; Octavia flavor_id referencing a nonexistent flavor; API outage during scale-up.
Related errors
- error deleting loadbalancer: %v
- failed to list loadbalancers: %s
- failed to list members: %v
- failed to list pools: %v
- failed to list listeners: %v
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/d29ad327deedf3c4.
Report an issue: GitHub.