Fix AWS CCM defaults for IPAM to match KCM

This commit is contained in:
John Gardiner Myers 2023-07-18 23:09:22 -07:00
parent a8fa8952ba
commit 11069febb1
1 changed files with 4 additions and 10 deletions

View File

@ -55,22 +55,16 @@ func (b *AWSCloudControllerManagerOptionsBuilder) BuildOptions(o interface{}) er
eccm.ClusterName = b.ClusterName
eccm.ClusterCIDR = clusterSpec.Networking.NonMasqueradeCIDR
eccm.AllocateNodeCIDRs = fi.PtrTo(!clusterSpec.IsKopsControllerIPAM())
eccm.AllocateNodeCIDRs = fi.PtrTo(true)
eccm.ConfigureCloudRoutes = fi.PtrTo(false)
if eccm.ClusterCIDR == "" && !clusterSpec.IsKopsControllerIPAM() {
eccm.ClusterCIDR = clusterSpec.Networking.PodCIDR
}
// TODO: we want to consolidate this with the logic from KCM
networking := &clusterSpec.Networking
if networking.Kubenet != nil {
eccm.ConfigureCloudRoutes = fi.PtrTo(true)
} else if networking.GCP != nil {
eccm.ConfigureCloudRoutes = fi.PtrTo(false)
eccm.CIDRAllocatorType = fi.PtrTo("CloudAllocator")
if eccm.ClusterCIDR == "" {
eccm.ClusterCIDR = clusterSpec.Networking.PodCIDR
}
} else if networking.External != nil {
eccm.ConfigureCloudRoutes = fi.PtrTo(false)
} else if UsesCNI(networking) {