Change:
Cloud-providers started to move out of tree its controller, but they share some functionalities, one of them is the NodeIPAM controller. There is a type that is GCE specific, the type. If this type is used, but no configuration for GCE is passed, the kcm panics. This can be observed in the following job: The question is, should this type be removed or a noop in KCM?
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the label and provide further guidance. The label can be by org members by writing in a comment. <detailsInstructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
/assign /cc
/sig cloud-provider
Is this a case of CCM handling IPAM so KCM needs to not handle it? What I mean is why is this set without a config? What was the intention? The fact that this has GCE-cloud-provider baked in is awful and should probably have been inverted (GCE provider calls a "register" method or something), but that's aside
Context: I started to set up jobs using the CCM by default, the cluster set up uses the script. The script doesn't consider IPAM, so it configures both KCM and CCM, but if set to "external" , it doesn't configure GCEPROVIDER in KCM When , the scripts set ... and CloudAllocator only runs with GCE My concern is that if this happens to me, it is possible that users that have to migrate custom cluster will face the same issue
A panic here seems appropriate, right? They specifically asked for a config that doesn't work and action needed to be taken. Am I misunderstanding?
A panic is appropriate given we never did any handling of this corner case -- I think it would be reasonable going forward to have a check in place to disable nodeipam controller if the allocator is but the cloud provider is not configured.
Opened with the check and a warning when this happens. We can also consider erroring out KCM if we see this happen so it's really clear to users that they misconfigured something

Discussion:
return nil, false, nil } <ins> // Cannot run cloud ipam controller if cloud provider is nil (--cloud-provider not set or set to 'external') if cloud == nil && ccmConfig.ComponentConfig.KubeCloudShared.CIDRAllocatorType == string(ipam.CloudAllocatorType) { return nil, false, errors.New("--cidr-allocator-type is set to 'CloudAllocator' but cloud provider is not configured") } </ins> // failure: bad cidrs in config clusterCIDRs, dualStack, err := processCIDRs(ccmConfig.ComponentConfig.KubeCloudShared.ClusterCIDR) if err != nil {

return nil, false, nil } <ins> // Cannot run cloud ipam controller if cloud provider is nil (--cloud-provider not set or set to 'external') if controllerContext.Cloud == nil && controllerContext.ComponentConfig.KubeCloudShared.CIDRAllocatorType == string(ipam.CloudAllocatorType) { return nil, false, errors.New("--cidr-allocator-type is set to 'CloudAllocator' but cloud provider is not configured") } </ins> clusterCIDRs, err := validateCIDRs(controllerContext.ComponentConfig.KubeCloudShared.ClusterCIDR) if err != nil { return nil, false, err