Skip to content

Commit

Permalink
Update instance types
Browse files Browse the repository at this point in the history
  • Loading branch information
Claes Mogren committed May 9, 2019
1 parent a5caa53 commit 2a061ac
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 9 deletions.
8 changes: 4 additions & 4 deletions pkg/awsutils/awsutils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ func TestAllocAllIPAddress(t *testing.T) {
// the expected addresses for c5n.18xlarge
input = &ec2.AssignPrivateIpAddressesInput{
NetworkInterfaceId: aws.String("eni-id"),
SecondaryPrivateIpAddressCount: aws.Int64(30),
SecondaryPrivateIpAddressCount: aws.Int64(49),
}
mockEC2.EXPECT().AssignPrivateIpAddresses(input).Return(nil, nil)

Expand Down Expand Up @@ -598,16 +598,16 @@ func TestAllocIPAddresses(t *testing.T) {

assert.NoError(t, err)

// when required IP numbers(31) is higher than ENI's limit(30)
// when required IP numbers(50) is higher than ENI's limit(49)
input = &ec2.AssignPrivateIpAddressesInput{
NetworkInterfaceId: aws.String("eni-id"),
SecondaryPrivateIpAddressCount: aws.Int64(30),
SecondaryPrivateIpAddressCount: aws.Int64(49),
}
mockEC2.EXPECT().AssignPrivateIpAddresses(input).Return(nil, nil)

ins = &EC2InstanceMetadataCache{ec2SVC: mockEC2, instanceType: "c5n.18xlarge"}

err = ins.AllocIPAddresses("eni-id", 30)
err = ins.AllocIPAddresses("eni-id", 50)

assert.NoError(t, err)
}
Expand Down
44 changes: 39 additions & 5 deletions pkg/awsutils/vpc_ip_resource_limit.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ var InstanceENIsAvailable = map[string]int{
"i3.8xlarge": 8,
"i3.16xlarge": 15,
"i3.metal": 15,
"i3en.large": 3,
"i3en.xlarge": 4,
"i3en.2xlarge": 4,
"i3en.3xlarge": 4,
"i3en.6xlarge": 8,
"i3en.12xlarge": 8,
"i3en.24xlarge": 15,
"m1.small": 2,
"m1.medium": 2,
"m1.large": 3,
Expand Down Expand Up @@ -180,6 +187,13 @@ var InstanceENIsAvailable = map[string]int{
"t3.large": 3,
"t3.xlarge": 4,
"t3.2xlarge": 4,
"t3a.nano": 2,
"t3a.micro": 2,
"t3a.small": 3,
"t3a.medium": 3,
"t3a.large": 3,
"t3a.xlarge": 4,
"t3a.2xlarge": 4,
"u-6tb1.metal": 5,
"u-9tb1.metal": 5,
"u-12tb1.metal": 5,
Expand Down Expand Up @@ -236,7 +250,7 @@ var InstanceIPsAvailable = map[string]int{
"c5n.2xlarge": 15,
"c5n.4xlarge": 30,
"c5n.9xlarge": 30,
"c5n.18xlarge": 31,
"c5n.18xlarge": 50,
"cc2.8xlarge": 30,
"cr1.8xlarge": 30,
"d2.xlarge": 15,
Expand Down Expand Up @@ -268,6 +282,13 @@ var InstanceIPsAvailable = map[string]int{
"i3.8xlarge": 30,
"i3.16xlarge": 31,
"i3.metal": 31,
"i3en.large": 10,
"i3en.xlarge": 15,
"i3en.2xlarge": 15,
"i3en.3xlarge": 15,
"i3en.6xlarge": 30,
"i3en.12xlarge": 30,
"i3en.24xlarge": 50,
"m1.small": 4,
"m1.medium": 6,
"m1.large": 10,
Expand Down Expand Up @@ -296,13 +317,13 @@ var InstanceIPsAvailable = map[string]int{
"m5a.2xlarge": 15,
"m5a.4xlarge": 30,
"m5a.12xlarge": 30,
"m5a.24xlarge": 31,
"m5a.24xlarge": 50,
"m5ad.large": 10,
"m5ad.xlarge": 15,
"m5ad.2xlarge": 15,
"m5ad.4xlarge": 30,
"m5ad.12xlarge": 30,
"m5ad.24xlarge": 31,
"m5ad.24xlarge": 50,
"m5d.large": 10,
"m5d.xlarge": 15,
"m5d.2xlarge": 15,
Expand Down Expand Up @@ -338,13 +359,19 @@ var InstanceIPsAvailable = map[string]int{
"r5a.2xlarge": 15,
"r5a.4xlarge": 30,
"r5a.12xlarge": 30,
"r5a.24xlarge": 31,
"r5a.24xlarge": 50,
"r5ad.large": 10,
"r5ad.xlarge": 15,
"r5ad.2xlarge": 15,
"r5ad.4xlarge": 30,
"r5ad.12xlarge": 30,
"r5ad.24xlarge": 50,
"r5d.large": 10,
"r5d.xlarge": 15,
"r5d.2xlarge": 15,
"r5d.4xlarge": 30,
"r5d.12xlarge": 30,
"r5d.24xlarge": 31,
"r5d.24xlarge": 50,
"t1.micro": 2,
"t2.nano": 2,
"t2.micro": 2,
Expand All @@ -360,6 +387,13 @@ var InstanceIPsAvailable = map[string]int{
"t3.large": 12,
"t3.xlarge": 15,
"t3.2xlarge": 15,
"t3a.nano": 2,
"t3a.micro": 2,
"t3a.small": 4,
"t3a.medium": 6,
"t3a.large": 12,
"t3a.xlarge": 15,
"t3a.2xlarge": 15,
"u-6tb1.metal": 30,
"u-9tb1.metal": 30,
"u-12tb1.metal": 30,
Expand Down

0 comments on commit 2a061ac

Please sign in to comment.