kubernetes/kops · error

error initializing Akamai (Linode) cloud: %w

Error message

error initializing Akamai (Linode) cloud: %w

What it means

After determining the Linode region from the cluster subnets, BuildCloud calls linode.NewCloud(region) to build the API client. This error wraps any failure from that constructor — typically credential or API-endpoint problems — so the underlying cause is chained via %w.

Source

Thrown at upup/pkg/fi/cloudup/utils.go:224

		if err != nil {
			return nil, fmt.Errorf("error initializing Metal cloud: %w", err)
		}
		cloud = metalCloud

	case kops.CloudProviderLinode:
		for _, subnet := range cluster.Spec.Networking.Subnets {
			if subnet.Region != "" {
				region = subnet.Region
				break
			}
		}
		if region == "" {
			return nil, fmt.Errorf("on Akamai (Linode), subnets must include Regions")
		}

		linodeCloud, err := linode.NewCloud(region)
		if err != nil {
			return nil, fmt.Errorf("error initializing Akamai (Linode) cloud: %w", err)
		}

		cloud = linodeCloud
	default:
		return nil, fmt.Errorf("unknown CloudProvider %q", cluster.GetCloudProvider())
	}
	return cloud, nil
}

func FindDNSHostedZone(dns dnsprovider.Interface, clusterDNSName string, dnsType kops.DNSType) (string, error) {
	klog.V(2).Infof("Querying for all DNS zones to find match for %q", clusterDNSName)

	clusterDNSName = "." + strings.TrimSuffix(clusterDNSName, ".")

	zonesProvider, ok := dns.Zones()
	if !ok {
		return "", fmt.Errorf("dns provider %T does not support zones", dns)
	}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Export a valid API token: `export LINODE_TOKEN=<token>` (check it with a Linode CLI/API call).
  2. Confirm the subnet region is a valid Linode region slug (e.g. us-east, ap-south).
  3. Check network egress to api.linode.com (proxies, firewalls) and retry; inspect the wrapped %w cause for the exact API error.

Example fix

// before
kops create cluster ... # fails: LINODE_TOKEN empty
// after
export LINODE_TOKEN=xxxxxxxx
kops create cluster ...
Defensive patterns

Strategy: validation

Validate before calling

if os.Getenv("LINODE_TOKEN") == "" {
    return errors.New("LINODE_TOKEN must be set")
}

Prevention

When it happens

Trigger: BuildCloud with CloudProvider linode and linode.NewCloud(region) returns an error: missing/invalid LINODE_TOKEN, malformed region, or client construction failure during kops create/update/delete commands.

Common situations: Environment variable LINODE_TOKEN unset or expired when running `kops create cluster` or `kops update cluster` in CI; mistyped region slug; network/proxy blocking api.linode.com; stale kops binary incompatible with current Linode API.

Related errors


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