kubernetes/kops · error

error initializing Metal cloud: %w

Error message

error initializing Metal cloud: %w

What it means

Thrown in BuildCloud when metal.NewCloud fails while constructing the Equinix Metal cloud interface. Construction fails primarily because Equinix Metal API credentials are missing from the environment or invalid, so no API client can be built for the provisioning run.

Source

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

				scaleway.TagClusterName: cluster.ObjectMeta.Name,
				"zone":                  string(zone),
				"region":                string(region),
			}
			for k, v := range cluster.Spec.CloudLabels {
				cloudTags[k] = v
			}

			scwCloud, err := scaleway.NewScwCloud(cloudTags)
			if err != nil {
				return nil, fmt.Errorf("error initializing Scaleway cloud: %w", err)
			}

			cloud = scwCloud
		}
	case kops.CloudProviderMetal:
		metalCloud, err := metal.NewCloud()
		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)
		}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Set a valid Equinix Metal API key in the environment variable the metal cloud implementation expects (e.g. METAL_API_TOKEN)
  2. Verify the token is active for the target project
  3. Re-run the operation after credentials are configured
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/utils.go:207 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/47719f765b3eca32. Report an issue: GitHub.