kubernetes/kops · error

unhandled load-balancer type %q

Error message

unhandled load-balancer type %q

What it means

The switch over spec.api.loadBalancer.type hit the default case in the Scaleway LB builder: the configured type matches neither Public nor Internal. It indicates an unrecognized/unsupported enum value for this provider.

Source

Thrown at pkg/model/scalewaymodel/api_loadbalancer.go:55

}

var _ fi.CloudupModelBuilder = &APILoadBalancerModelBuilder{}

func (b *APILoadBalancerModelBuilder) Build(c *fi.CloudupModelBuilderContext) error {
	// Configuration where a load balancer fronts the API
	if !b.UseLoadBalancerForAPI() {
		return nil
	}

	lbSpec := b.Cluster.Spec.API.LoadBalancer

	switch lbSpec.Type {
	case kops.LoadBalancerTypePublic:
		klog.V(8).Infof("Using public load-balancer")
	case kops.LoadBalancerTypeInternal:
		return fmt.Errorf("Scaleway clusters don't have a VPC yet, so internal load-balancers are not supported at the time")
	default:
		return fmt.Errorf("unhandled load-balancer type %q", lbSpec.Type)
	}

	zone, err := scaleway.ParseZoneFromClusterSpec(b.Cluster.Spec)
	if err != nil {
		return fmt.Errorf("building load-balancer task: %w", err)
	}

	lbTags := []string{
		fmt.Sprintf("%s=%s", scaleway.TagClusterName, b.ClusterName()),
		fmt.Sprintf("%s=%s", scaleway.TagNameRolePrefix, scaleway.TagRoleControlPlane),
	}
	for k, v := range b.CloudTags(b.ClusterName(), false) {
		lbTags = append(lbTags, fmt.Sprintf("%s=%s", k, v))
	}

	loadBalancerName := "api." + b.ClusterName()
	loadBalancer := &scalewaytasks.LoadBalancer{
		Name:                  new(loadBalancerName),

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Set spec.api.loadBalancer.type to a supported value (Public) in the cluster spec
  2. Upgrade kOps if a newer load-balancer type is expected to be supported
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at pkg/model/scalewaymodel/api_loadbalancer.go:55 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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