{"record":{"id":"5066cd5d73a65f8f","repo":"kubernetes/kops","slug":"creating-metal-ipam-controller-w","errorCode":null,"errorMessage":"creating metal IPAM controller: %w","messagePattern":"creating metal IPAM controller: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops-controller/main.go","lineNumber":418,"sourceCode":"\tsetupLog.Info(\"enabling IPAM controller\")\n\tvar controller Reconciler\n\tswitch opt.Cloud {\n\tcase \"aws\":\n\t\tipamController, err := controllers.NewAWSIPAMReconciler(ctx, mgr)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"creating aws IPAM controller: %w\", err)\n\t\t}\n\t\tcontroller = ipamController\n\tcase \"gce\":\n\t\tipamController, err := controllers.NewGCEIPAMReconciler(mgr)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"creating gce IPAM controller: %w\", err)\n\t\t}\n\t\tcontroller = ipamController\n\tcase \"metal\":\n\t\tipamController, err := controllers.NewMetalIPAMReconciler(ctx, mgr)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"creating metal IPAM controller: %w\", err)\n\t\t}\n\t\tcontroller = ipamController\n\tdefault:\n\t\treturn fmt.Errorf(\"kOps IPAM controller is not supported on cloud %q\", opt.Cloud)\n\t}\n\n\tif err := controller.SetupWithManager(mgr); err != nil {\n\t\treturn fmt.Errorf(\"registering IPAM controller: %w\", err)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":400,"sourceCodeEnd":431,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops-controller/main.go#L400-L431","documentation":"kops-controller failed while constructing the Metal (bare-metal) IPAM reconciler, which allocates IPs on metal deployments. NewMetalIPAMReconciler returned an error, wrapped here with context via %w. The controller exits before registering any reconcilers.","triggerScenarios":"controllers.NewMetalIPAMReconciler(ctx, mgr) returns err; triggered when opt.Cloud == \"metal\" with the IPAM controller enabled.","commonSituations":"Invalid metal/IPAM configuration (e.g. missing CIDR config in cluster spec); failure constructing the metal cloud provider; running metal mode accidentally via wrong --cloud flag; version mismatch between nodeup/kops-controller.","solutions":["Check the wrapped root cause in the log output","Validate the cluster spec's metal networking/IPAM configuration","Ensure --cloud=metal is intended for this deployment","Disable IPAM controller if using static IP allocation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// validate metal IPAM prerequisites before start\nif opt.Cloud == \"metal\" && cluster.Spec.Networking == nil {\n\treturn fmt.Errorf(\"metal IPAM requires networking config in cluster spec\")\n}","typeGuard":null,"tryCatchPattern":"if err := setupCloudIPAM(ctx, controllers, mgr, opt); err != nil {\n\tsetupLog.Error(err, \"IPAM controller setup failed\")\n\tos.Exit(1)\n}","preventionTips":["Validate the metal networking/IPAM section of the cluster spec before rollout","Only enable IPAM on metal if using dynamic IP allocation","Test config changes with `kops replace` validation first"],"tags":["metal","bare-metal","ipam","controller-runtime","startup"],"backgroundTag":"controller-init-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}