Skip to content

Commit

Permalink
Add trn1 limits (#2092)
Browse files Browse the repository at this point in the history
* Add trn1 limits

* Properly handle MaximumNetworkInterfaces for multi-card instance types

* Fix formatting
  • Loading branch information
cartermckinnon authored Sep 22, 2022
1 parent 8517fce commit 3ca86c7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
4 changes: 3 additions & 1 deletion misc/eni-max-pods.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
#
# This file was generated at 2022-08-15T23:21:13Z
# This file was generated at 2022-09-21T13:34:09-07:00
#
# The regions queried were:
# - ap-northeast-1
Expand Down Expand Up @@ -554,6 +554,8 @@ t4g.micro 4
t4g.nano 4
t4g.small 11
t4g.xlarge 58
trn1.2xlarge 58
trn1.32xlarge 247
u-12tb1.112xlarge 737
u-12tb1.metal 147
u-18tb1.metal 737
Expand Down
8 changes: 5 additions & 3 deletions pkg/awsutils/vpc_ip_resource_limit.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 7 additions & 12 deletions scripts/gen_vpc_ip_limits.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,13 @@ func describeInstanceTypes(region string, eniLimitMap map[string]awsutils.Instan
for _, info := range output.InstanceTypes {
// Ignore any missing values
instanceType := aws.StringValue(info.InstanceType)
eniLimit := int(aws.Int64Value(info.NetworkInfo.MaximumNetworkInterfaces))
// only one network card is supported, so use the MaximumNetworkInterfaces from the default card if more than one are present
var eniLimit int
if len(info.NetworkInfo.NetworkCards) > 1 {
eniLimit = int(aws.Int64Value(info.NetworkInfo.NetworkCards[*info.NetworkInfo.DefaultNetworkCardIndex].MaximumNetworkInterfaces))
} else {
eniLimit = int(aws.Int64Value(info.NetworkInfo.MaximumNetworkInterfaces))
}
ipv4Limit := int(aws.Int64Value(info.NetworkInfo.Ipv4AddressesPerInterface))
hypervisorType := aws.StringValue(info.Hypervisor)
isBareMetalInstance := aws.BoolValue(info.BareMetal)
Expand Down Expand Up @@ -200,18 +206,7 @@ func addManualLimits(limitMap map[string]awsutils.InstanceTypeLimits) map[string
"u-9tb1.metal": {ENILimit: 5, IPv4Limit: 30, HypervisorType: "unknown", IsBareMetal: true},
"c5a.metal": {ENILimit: 15, IPv4Limit: 50, HypervisorType: "unknown", IsBareMetal: true},
"c5ad.metal": {ENILimit: 15, IPv4Limit: 50, HypervisorType: "unknown", IsBareMetal: true},
"p4d.24xlarge": {ENILimit: 15, IPv4Limit: 50, HypervisorType: "unknown", IsBareMetal: false},
"p4de.24xlarge": {ENILimit: 15, IPv4Limit: 50, HypervisorType: "unknown", IsBareMetal: false},
"dl1.24xlarge": {ENILimit: 15, IPv4Limit: 50, HypervisorType: "unknown", IsBareMetal: false},
"c6g.xlarge": {ENILimit: 4, IPv4Limit: 15, HypervisorType: "nitro", IsBareMetal: false},
"c7g.12xlarge": {ENILimit: 8, IPv4Limit: 30, HypervisorType: "nitro", IsBareMetal: false},
"c7g.16xlarge": {ENILimit: 15, IPv4Limit: 50, HypervisorType: "nitro", IsBareMetal: false},
"c7g.2xlarge": {ENILimit: 4, IPv4Limit: 15, HypervisorType: "nitro", IsBareMetal: false},
"c7g.4xlarge": {ENILimit: 8, IPv4Limit: 30, HypervisorType: "nitro", IsBareMetal: false},
"c7g.8xlarge": {ENILimit: 8, IPv4Limit: 30, HypervisorType: "nitro", IsBareMetal: false},
"c7g.large": {ENILimit: 3, IPv4Limit: 10, HypervisorType: "nitro", IsBareMetal: false},
"c7g.medium": {ENILimit: 2, IPv4Limit: 4, HypervisorType: "nitro", IsBareMetal: false},
"c7g.xlarge": {ENILimit: 4, IPv4Limit: 15, HypervisorType: "nitro", IsBareMetal: false},
"c7g.metal": {ENILimit: 15, IPv4Limit: 50, HypervisorType: "unknown", IsBareMetal: true},
}
for instanceType, instanceLimits := range manuallyAddedLimits {
Expand Down

0 comments on commit 3ca86c7

Please sign in to comment.