Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions upup/pkg/fi/cloudup/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ import (
kopsversion "k8s.io/kops"
)

const (
defaultAWSNetworkCIDR = "172.20.0.0/16"
defaultAzureNetworkCIDR = "10.0.0.0/16"
defaultNonMasqueradeCIDR = "100.64.0.0/10"
)

// PerformAssignments populates values that are required and immutable
// For example, it assigns stable Keys to InstanceGroups & Masters, and
// it assigns CIDRs to subnets
Expand Down Expand Up @@ -85,7 +91,7 @@ func PerformAssignments(c *kops.Cluster, vfsContext *vfs.VFSContext, cloud fi.Cl
}
} else {
// TODO: Choose non-overlapping networking CIDRs for VPCs, using vpcInfo
c.Spec.Networking.NetworkCIDR = "172.20.0.0/16"
c.Spec.Networking.NetworkCIDR = defaultAWSNetworkCIDR
}

// Amazon VPC CNI uses the same network
Expand All @@ -111,12 +117,12 @@ func PerformAssignments(c *kops.Cluster, vfsContext *vfs.VFSContext, cloud fi.Cl
return fmt.Errorf("unable to infer NetworkCIDR from Network ID, please specify --network-cidr")
}
} else {
c.Spec.Networking.NetworkCIDR = "10.0.0.0/16"
c.Spec.Networking.NetworkCIDR = defaultAzureNetworkCIDR
}
}

if c.Spec.Networking.NonMasqueradeCIDR == "" {
c.Spec.Networking.NonMasqueradeCIDR = "100.64.0.0/10"
c.Spec.Networking.NonMasqueradeCIDR = defaultNonMasqueradeCIDR
}

// TODO: Unclear this should be here - it isn't too hard to change
Expand Down
Loading