kubernetes/kops · error

registering IPAM controller: %w

Error message

registering IPAM controller: %w

What it means

The selected IPAM reconciler was created successfully but controller.SetupWithManager(mgr) failed, meaning controller-runtime rejected the registration (typically bad builder options, invalid Scheme GVK registration, or manager already started/invalid). setupCloudIPAM wraps the cause with this message and startup aborts.

Source

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

		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. Inspect the wrapped cause to see which SetupWithManager step failed
  2. Verify the kops Scheme registers all types the IPAM reconciler watches
  3. Ensure the manager was not started before SetupWithManager was called
  4. Rebuild kops-controller from the matching source/version to avoid skew
Defensive patterns

Strategy: try-catch

Try / catch

if err := controller.SetupWithManager(mgr); err != nil {
	setupLog.Error(err, "registering IPAM controller failed")
	return fmt.Errorf("registering IPAM controller: %w", err)
}
// caller: errors.As to unwrap the controller-runtime cause

Prevention

When it happens

Trigger: controller.SetupWithManager(mgr) returns err after a successful reconciler construction, for any of aws/gce/metal.

Common situations: Scheme missing the types the controller watches; manager built with incompatible options; running inside a modified/patched kops-controller; controller-runtime version skew between libraries.

Related errors


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