kubernetes/kops · error

creating gce IPAM controller: %w

Error message

creating gce IPAM controller: %w

What it means

kops-controller failed while constructing the GCE IPAM reconciler, which manages Google Cloud IP address allocation for nodes. NewGCEIPAMReconciler returned an error and setupCloudIPAM wraps it with this message. Startup of the controller manager aborts.

Source

Thrown at cmd/kops-controller/main.go:412

// Reconciler is the interface for a standard Reconciler.
type Reconciler interface {
	SetupWithManager(mgr manager.Manager) error
}

func setupCloudIPAM(ctx context.Context, mgr manager.Manager, opt *config.Options) error {
	setupLog.Info("enabling IPAM controller")
	var controller Reconciler
	switch opt.Cloud {
	case "aws":
		ipamController, err := controllers.NewAWSIPAMReconciler(ctx, mgr)
		if err != nil {
			return fmt.Errorf("creating aws IPAM controller: %w", err)
		}
		controller = ipamController
	case "gce":
		ipamController, err := controllers.NewGCEIPAMReconciler(mgr)
		if err != nil {
			return fmt.Errorf("creating gce IPAM controller: %w", err)
		}
		controller = ipamController
	case "metal":
		ipamController, err := controllers.NewMetalIPAMReconciler(ctx, mgr)
		if err != nil {
			return fmt.Errorf("creating metal IPAM controller: %w", err)
		}
		controller = ipamController
	default:
		return fmt.Errorf("kOps IPAM controller is not supported on cloud %q", opt.Cloud)
	}

	if err := controller.SetupWithManager(mgr); err != nil {
		return fmt.Errorf("registering IPAM controller: %w", err)
	}

	return nil
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Read the wrapped cause in the log for the concrete NewGCEIPAMReconciler failure
  2. Verify GCP credentials/project are correctly configured for the controller
  3. Check that --cloud=gce matches the actual environment
  4. Disable the IPAM controller if GCE IPAM is not in use
Defensive patterns

Strategy: validation

Validate before calling

// before enabling IPAM on gce
if opt.Cloud == "gce" {
	if os.Getenv("GOOGLE_APPLICATION_CREDENTIALS") == "" {
		return fmt.Errorf("GCE credentials not configured")
	}
}

Try / catch

if err := setupCloudIPAM(ctx, controllers, mgr, opt); err != nil {
	setupLog.Error(err, "IPAM controller setup failed")
	os.Exit(1)
}

Prevention

When it happens

Trigger: controllers.NewGCEIPAMReconciler(mgr) returns err; triggered when opt.Cloud == "gce" with the IPAM controller enabled.

Common situations: Missing or invalid GCP service-account credentials; failure constructing the GCE cloud client; wrong --cloud value on a non-GCP environment after config edit; kops upgrade incompatibility.

Related errors


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