Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

9 bit minimum cluster size req is for Azure CNI only #1863

Merged
merged 1 commit into from
Dec 1, 2017
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
8 changes: 5 additions & 3 deletions pkg/api/vlabs/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,11 @@ func (a *KubernetesConfig) Validate(k8sVersion string) error {
return fmt.Errorf("OrchestratorProfile.KubernetesConfig.ClusterSubnet '%s' is an invalid subnet", a.ClusterSubnet)
}

ones, bits := subnet.Mask.Size()
if bits-ones <= 8 {
return fmt.Errorf("OrchestratorProfile.KubernetesConfig.ClusterSubnet '%s' must reserve at least 9 bits for nodes", a.ClusterSubnet)
if a.NetworkPolicy == "azure" {
ones, bits := subnet.Mask.Size()
if bits-ones <= 8 {
return fmt.Errorf("OrchestratorProfile.KubernetesConfig.ClusterSubnet '%s' must reserve at least 9 bits for nodes", a.ClusterSubnet)
}
}
}

Expand Down