Merge pull request #14962 from justinsb/gce_kcm_and_ccm_node_cidr_conflict

gce: KCM should not allocate IPs when CCM is in use.
This commit is contained in:
Kubernetes Prow Robot 2023-01-07 17:15:27 -08:00 committed by GitHub
commit 4783cbe4f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -150,7 +150,12 @@ func (b *KubeControllerManagerOptionsBuilder) BuildOptions(o interface{}) error
kcm.ConfigureCloudRoutes = fi.PtrTo(true)
} else if networking.GCE != nil {
kcm.ConfigureCloudRoutes = fi.PtrTo(false)
kcm.CIDRAllocatorType = fi.PtrTo("CloudAllocator")
if kcm.CloudProvider == "external" {
// kcm should not allocate node cidrs with the CloudAllocator if we're using the external CCM
kcm.AllocateNodeCIDRs = fi.PtrTo(false)
} else {
kcm.CIDRAllocatorType = fi.PtrTo("CloudAllocator")
}
} else if networking.External != nil {
kcm.ConfigureCloudRoutes = fi.PtrTo(false)
} else if UsesCNI(networking) {