Skip to content

Commit

Permalink
Lower minimum subnets and AZs to 2
Browse files Browse the repository at this point in the history
EKS docs suggest that the minimum required subnets/AZs is now 2. Also
updated tests and logging that reference the minimum subnets/AZs.

Issue #290
  • Loading branch information
jonk committed Nov 1, 2018
1 parent fa8e249 commit f44de4b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/az/az.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

const (
// DefaultRequiredAvailabilityZones defines the number of required availability zones
DefaultRequiredAvailabilityZones = 3
DefaultRequiredAvailabilityZones = 2
)

// SelectionStrategy provides an interface to allow changing the strategy used to
Expand Down
6 changes: 3 additions & 3 deletions pkg/az/az_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var _ = Describe("AZ", func() {
})

It("should have returned 3 availability zones", func() {
Expect(len(selectedZones)).To(Equal(3))
Expect(len(selectedZones)).To(Equal(2))
})
})

Expand Down Expand Up @@ -112,7 +112,7 @@ var _ = Describe("AZ", func() {
})

It("should have returned 3 identical availability zones", func() {
Expect(len(selectedZones)).To(Equal(3))
Expect(len(selectedZones)).To(Equal(2))

for _, actualZoneName := range selectedZones {
Expect(actualZoneName).To(Equal(*expectedZoneName))
Expand Down Expand Up @@ -161,7 +161,7 @@ var _ = Describe("AZ", func() {
})

It("should have returned 3 availability zones", func() {
Expect(len(selectedZones)).To(Equal(3))
Expect(len(selectedZones)).To(Equal(2))
})

It("should have returned none of the zones to avoid", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/eks/api/vpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ func (c *ClusterConfig) ImportSubnet(topology SubnetTopology, az, subnetID strin
// HasSufficientPublicSubnets validates if there is a sufficient
// number of public subnets available to create a cluster
func (c *ClusterConfig) HasSufficientPublicSubnets() bool {
return len(c.SubnetIDs(SubnetTopologyPublic)) >= 3
return len(c.SubnetIDs(SubnetTopologyPublic)) >= 2
}

// HasSufficientPrivateSubnets validates if there is a sufficient
// number of private subnets available to create a cluster
func (c *ClusterConfig) HasSufficientPrivateSubnets() bool {
return len(c.SubnetIDs(SubnetTopologyPrivate)) >= 3
return len(c.SubnetIDs(SubnetTopologyPrivate)) >= 2
}
2 changes: 1 addition & 1 deletion pkg/kops/kops.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (k *Wrapper) UseVPC(spec *api.ClusterConfig) error {
}
logger.Debug("subnets = %#v", spec.VPC.Subnets)
if !spec.HasSufficientPublicSubnets() {
return fmt.Errorf("cannot use VPC from kops cluster with less then 3 subnets")
return fmt.Errorf("cannot use VPC from kops cluster with less then 2 subnets")
}

return nil
Expand Down

0 comments on commit f44de4b

Please sign in to comment.