Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
allow smaller pod network subnets (#2183)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Nisbet authored Oct 1, 2020
1 parent 0ff7f47 commit 37df12c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/validate/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ func KubernetesSubnetsFromStrings(podCIDR, serviceCIDR string) error {
func KubernetesSubnets(podNet, serviceNet *net.IPNet) (err error) {
if podNet != nil {
// make sure the pod subnet is valid
// the pod network should be /16 minimum so k8s can allocate /24 to each node
// the pod network should be /22 minimum so k8s can allocate /24 to each node (minimum 3 nodes)
ones, _ := podNet.Mask.Size()
if ones > 16 {
if ones > 22 {
return trace.BadParameter(
"pod subnet should be a minimum of /16: %q", podNet.String())
"pod subnet should be a minimum of /22: %q", podNet.String())
}
}
if podNet != nil && serviceNet != nil {
Expand Down
2 changes: 1 addition & 1 deletion lib/validate/net_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (*S) TestValidateKubernetesSubnets(c *check.C) {
description: "service subnet is not a valid CIDR",
},
{
podCIDR: "10.200.0.0/20",
podCIDR: "10.200.0.0/24",
ok: false,
description: "pod subnet is too small",
},
Expand Down

0 comments on commit 37df12c

Please sign in to comment.