kubernetes/kops · error

creation of AWS Classic Load Balancers is no longer supporte

Error message

creation of AWS Classic Load Balancers is no longer supported

What it means

kOps no longer supports creating new AWS Classic Load Balancers. CheckChanges validates at plan time: if a ClassicLoadBalancer task is being created (a == nil) and is not marked Shared, creation is rejected before any API call.

Source

Thrown at upup/pkg/fi/cloudup/awstasks/classic_load_balancer.go:151

func (e *ClassicLoadBalancer) Run(c *fi.CloudupContext) error {
	return fi.CloudupDefaultDeltaRunMethod(e, c)
}

func (_ *ClassicLoadBalancer) ShouldCreate(a, e, changes *ClassicLoadBalancer) (bool, error) {
	if fi.ValueOf(e.Shared) {
		return false, nil
	}
	return true, nil
}

func (s *ClassicLoadBalancer) CheckChanges(a, e, changes *ClassicLoadBalancer) error {
	if a == nil {
		if fi.ValueOf(e.Name) == "" {
			return fi.RequiredField("Name")
		}
		if !fi.ValueOf(e.Shared) {
			return fmt.Errorf("creation of AWS Classic Load Balancers is no longer supported")
		}
	}

	return nil
}

func (_ *ClassicLoadBalancer) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *ClassicLoadBalancer) error {
	if fi.ValueOf(e.Shared) {
		return nil
	}

	return fmt.Errorf("creation of AWS Classic Load Balancers is no longer supported")
}

// OrderLoadBalancersByName implements sort.Interface for []OrderLoadBalancersByName, based on name
type OrderLoadBalancersByName []*ClassicLoadBalancer

func (a OrderLoadBalancersByName) Len() int      { return len(a) }

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Migrate the cluster to a Network Load Balancer (or Application Load Balancer) per current kOps defaults
  2. If the ELB already exists and is externally managed, mark the task shared: true so kOps only adopts it
  3. Upgrade the cluster spec to the current load-balancer configuration
  4. Do not attempt to downgrade kOps; classic ELB creation is intentionally removed

Example fix

// before (attempting new creation)
classicLoadBalancer: {}
// after
classicLoadBalancer:
  shared: true  # only for adopting a pre-existing ELB; otherwise use NLB
Defensive patterns

Strategy: validation

Validate before calling

# fail fast before apply if spec defines non-shared classic ELB
if grep -A2 'classicLoadBalancer' cluster.yaml | grep -qv 'shared: true'; then
  echo 'ERROR: classic ELB creation unsupported; use NLB or set shared: true'; exit 1
fi

Type guard

function isShared(e) { return e.shared === true; }

Try / catch

try {
  task.CheckChanges(a, e, changes);
} catch (err) {
  if (String(err).includes('Classic Load Balancers is no longer supported')) {
    // migrate to NLB or set shared
  }
  throw err;
}

Prevention

When it happens

Trigger: A cluster spec still references a classic (ELB) load balancer for a new resource — e.g. an old cluster spec using type like 'classic' API load balancer — while the task lacks shared: true.

Common situations: Old cluster manifests from kOps versions that supported ELB creation being applied with a modern kOps; hand-written specs using classicloadbalancer tasks without shared flag.

Related errors


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