From 6bf3afb82ce9cd776d7aeefad6f1c8082476b2ad Mon Sep 17 00:00:00 2001 From: Brian Pursley Date: Thu, 16 Jul 2020 14:27:12 -0400 Subject: [PATCH] The reserved memory calculation was changed in amazon-eks-ami to be based on pod density (11*maxPodsPerNode+255) instead of total memory. See https://github.com/awslabs/amazon-eks-ami/blob/21426e27e3845319dbca92e7df32e5c4b984a1d1/files/bootstrap.sh#L163 This commit introduces a new MaxPodsPerNode property on InstanceTypeInfo and populates it using the data from maxpods.go so that it will be available for calculating the default memory to reserve. It removes the Memory property from InstanceTypeInfo because it is no longer needed. This commit also updates related unit tests. It fixes some unit tests which reference instance types which no longer exist and adds a check to make sure instance types which are expected to exist actually exist, and those which are not expected to exist do not exist. --- pkg/cfn/builder/api_test.go | 2 +- pkg/nodebootstrap/reserved.go | 27 +- pkg/nodebootstrap/reserved_data.go | 1755 +++++++++++++----------- pkg/nodebootstrap/reserved_generate.go | 6 +- pkg/nodebootstrap/reserved_test.go | 43 +- pkg/nodebootstrap/userdata.go | 12 +- pkg/nodebootstrap/userdata_test.go | 28 +- 7 files changed, 1022 insertions(+), 851 deletions(-) diff --git a/pkg/cfn/builder/api_test.go b/pkg/cfn/builder/api_test.go index 7cf5dab587..e5f6e1a9db 100644 --- a/pkg/cfn/builder/api_test.go +++ b/pkg/cfn/builder/api_test.go @@ -344,7 +344,7 @@ func completeKubeletConfig(kubeletConfigAssetContent []byte, clusterDNS string) "kubeReserved:\n" + " cpu: 70m\n" + " ephemeral-storage: 1Gi\n" + - " memory: 1843Mi\n" + " memory: 574Mi\n" } var _ = Describe("CloudFormation template builder API", func() { diff --git a/pkg/nodebootstrap/reserved.go b/pkg/nodebootstrap/reserved.go index 0f46a81fc0..461aa28feb 100644 --- a/pkg/nodebootstrap/reserved.go +++ b/pkg/nodebootstrap/reserved.go @@ -20,13 +20,6 @@ type progression []struct { } var ( - memProgression = progression{ - {upper: 4096, fraction: 0.25}, - {upper: 8192, fraction: 0.20}, - {upper: 16384, fraction: 0.10}, - {upper: 131072, fraction: 0.06}, - {upper: math.MaxInt64, fraction: 0.02}, - } cpuProgression = progression{ {upper: 1000, fraction: 0.06}, {upper: 2000, fraction: 0.01}, @@ -58,8 +51,8 @@ type InstanceTypeInfo struct { // Storage (ephemeral) available (GiB). // Is 0 if not supported or none available. Storage int64 - // Memory available (MiB). - Memory int64 + // Max pods per node. + MaxPodsPerNode int64 // CPU count. CPU int64 } @@ -74,8 +67,8 @@ func NewInstanceTypeInfo(ec2info *ec2.InstanceTypeInfo) InstanceTypeInfo { if aws.BoolValue(ec2info.InstanceStorageSupported) && ec2info.InstanceStorageInfo != nil { i.Storage = aws.Int64Value(ec2info.InstanceStorageInfo.TotalSizeInGB) } - if ec2info.MemoryInfo != nil { - i.Memory = aws.Int64Value(ec2info.MemoryInfo.SizeInMiB) + if maxPodsPerNode, exists := maxPodsPerNodeType[*ec2info.InstanceType]; exists { + i.MaxPodsPerNode = int64(maxPodsPerNode) } if ec2info.VCpuInfo != nil { i.CPU = aws.Int64Value(ec2info.VCpuInfo.DefaultVCpus) @@ -93,17 +86,9 @@ func (i InstanceTypeInfo) DefaultStorageToReserve() string { // DefaultMemoryToReserve returns how much memory to reserve. // -// See https://github.com/awslabs/amazon-eks-ami/blob/ff690788dfaf399e6919eebb59371ee923617df4/files/bootstrap.sh#L150-L181 -// which takes it form https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#node_allocatable -// -// 255 Mi of memory for machines with less than 1024Mi of memory -// 25% of the first 4096Mi of memory -// 20% of the next 4096Mi of memory (up to 8192Mi) -// 10% of the next 8192Mi of memory (up to 16384Mi) -// 6% of the next 114688Mi of memory (up to 131072Mi) -// 2% of any memory above 131072Mi +// See https://github.com/awslabs/amazon-eks-ami/blob/21426e27e3845319dbca92e7df32e5c4b984a1d1/files/bootstrap.sh#L154-L165 func (i InstanceTypeInfo) DefaultMemoryToReserve() string { - mib := memProgression.calculate(i.Memory, minimumMemoryToReserve) + mib := 11*i.MaxPodsPerNode + minimumMemoryToReserve return fmt.Sprintf("%dMi", mib) } diff --git a/pkg/nodebootstrap/reserved_data.go b/pkg/nodebootstrap/reserved_data.go index 3189700234..4fb985e8a6 100644 --- a/pkg/nodebootstrap/reserved_data.go +++ b/pkg/nodebootstrap/reserved_data.go @@ -1,1322 +1,1497 @@ package nodebootstrap -// This file was generated 2020-03-26T16:18:43-07:00 by reserved_generate.go; DO NOT EDIT. +// This file was generated 2020-07-16T12:21:47-04:00 by reserved_generate.go; DO NOT EDIT. // Data downloaded through the API. var instanceTypeInfos = map[string]InstanceTypeInfo{ "a1.2xlarge": { - CPU: int64(8), - Memory: int64(16384), - Storage: int64(0), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "a1.4xlarge": { - CPU: int64(16), - Memory: int64(32768), - Storage: int64(0), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "a1.large": { - CPU: int64(2), - Memory: int64(4096), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(0), }, "a1.medium": { - CPU: int64(1), - Memory: int64(2048), - Storage: int64(0), + CPU: int64(1), + MaxPodsPerNode: int64(8), + Storage: int64(0), }, "a1.metal": { - CPU: int64(16), - Memory: int64(32768), - Storage: int64(0), + CPU: int64(16), + MaxPodsPerNode: int64(0), + Storage: int64(0), }, "a1.xlarge": { - CPU: int64(4), - Memory: int64(8192), - Storage: int64(0), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "c1.medium": { - CPU: int64(2), - Memory: int64(1740), - Storage: int64(350), + CPU: int64(2), + MaxPodsPerNode: int64(12), + Storage: int64(350), }, "c1.xlarge": { - CPU: int64(8), - Memory: int64(7168), - Storage: int64(1680), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(1680), }, "c3.2xlarge": { - CPU: int64(8), - Memory: int64(15360), - Storage: int64(160), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(160), }, "c3.4xlarge": { - CPU: int64(16), - Memory: int64(30720), - Storage: int64(320), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(320), }, "c3.8xlarge": { - CPU: int64(32), - Memory: int64(61440), - Storage: int64(640), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(640), }, "c3.large": { - CPU: int64(2), - Memory: int64(3840), - Storage: int64(32), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(32), }, "c3.xlarge": { - CPU: int64(4), - Memory: int64(7680), - Storage: int64(80), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(80), }, "c4.2xlarge": { - CPU: int64(8), - Memory: int64(15360), - Storage: int64(0), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "c4.4xlarge": { - CPU: int64(16), - Memory: int64(30720), - Storage: int64(0), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "c4.8xlarge": { - CPU: int64(36), - Memory: int64(61440), - Storage: int64(0), + CPU: int64(36), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "c4.large": { - CPU: int64(2), - Memory: int64(3840), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(0), }, "c4.xlarge": { - CPU: int64(4), - Memory: int64(7680), - Storage: int64(0), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "c5.12xlarge": { - CPU: int64(48), - Memory: int64(98304), - Storage: int64(0), + CPU: int64(48), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "c5.18xlarge": { - CPU: int64(72), - Memory: int64(147456), - Storage: int64(0), + CPU: int64(72), + MaxPodsPerNode: int64(737), + Storage: int64(0), }, "c5.24xlarge": { - CPU: int64(96), - Memory: int64(196608), - Storage: int64(0), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(0), }, "c5.2xlarge": { - CPU: int64(8), - Memory: int64(16384), - Storage: int64(0), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "c5.4xlarge": { - CPU: int64(16), - Memory: int64(32768), - Storage: int64(0), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "c5.9xlarge": { - CPU: int64(36), - Memory: int64(73728), - Storage: int64(0), + CPU: int64(36), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "c5.large": { - CPU: int64(2), - Memory: int64(4096), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(0), }, "c5.metal": { - CPU: int64(96), - Memory: int64(196608), - Storage: int64(0), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(0), }, "c5.xlarge": { - CPU: int64(4), - Memory: int64(8192), - Storage: int64(0), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(0), + }, + "c5a.12xlarge": { + CPU: int64(48), + MaxPodsPerNode: int64(234), + Storage: int64(0), + }, + "c5a.16xlarge": { + CPU: int64(64), + MaxPodsPerNode: int64(737), + Storage: int64(0), + }, + "c5a.24xlarge": { + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(0), + }, + "c5a.2xlarge": { + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(0), + }, + "c5a.4xlarge": { + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(0), + }, + "c5a.8xlarge": { + CPU: int64(32), + MaxPodsPerNode: int64(0), + Storage: int64(0), + }, + "c5a.large": { + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(0), + }, + "c5a.xlarge": { + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "c5d.12xlarge": { - CPU: int64(48), - Memory: int64(98304), - Storage: int64(1800), + CPU: int64(48), + MaxPodsPerNode: int64(234), + Storage: int64(1800), }, "c5d.18xlarge": { - CPU: int64(72), - Memory: int64(147456), - Storage: int64(1800), + CPU: int64(72), + MaxPodsPerNode: int64(737), + Storage: int64(1800), }, "c5d.24xlarge": { - CPU: int64(96), - Memory: int64(196608), - Storage: int64(3600), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(3600), }, "c5d.2xlarge": { - CPU: int64(8), - Memory: int64(16384), - Storage: int64(200), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(200), }, "c5d.4xlarge": { - CPU: int64(16), - Memory: int64(32768), - Storage: int64(400), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(400), }, "c5d.9xlarge": { - CPU: int64(36), - Memory: int64(73728), - Storage: int64(900), + CPU: int64(36), + MaxPodsPerNode: int64(234), + Storage: int64(900), }, "c5d.large": { - CPU: int64(2), - Memory: int64(4096), - Storage: int64(50), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(50), }, "c5d.metal": { - CPU: int64(96), - Memory: int64(196608), - Storage: int64(3600), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(3600), }, "c5d.xlarge": { - CPU: int64(4), - Memory: int64(8192), - Storage: int64(100), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(100), }, "c5n.18xlarge": { - CPU: int64(72), - Memory: int64(196608), - Storage: int64(0), + CPU: int64(72), + MaxPodsPerNode: int64(737), + Storage: int64(0), }, "c5n.2xlarge": { - CPU: int64(8), - Memory: int64(21504), - Storage: int64(0), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "c5n.4xlarge": { - CPU: int64(16), - Memory: int64(43008), - Storage: int64(0), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "c5n.9xlarge": { - CPU: int64(36), - Memory: int64(98304), - Storage: int64(0), + CPU: int64(36), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "c5n.large": { - CPU: int64(2), - Memory: int64(5376), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(0), }, "c5n.metal": { - CPU: int64(72), - Memory: int64(196608), - Storage: int64(0), + CPU: int64(72), + MaxPodsPerNode: int64(0), + Storage: int64(0), }, "c5n.xlarge": { - CPU: int64(4), - Memory: int64(10752), - Storage: int64(0), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(0), + }, + "c6g.12xlarge": { + CPU: int64(48), + MaxPodsPerNode: int64(0), + Storage: int64(0), + }, + "c6g.16xlarge": { + CPU: int64(64), + MaxPodsPerNode: int64(0), + Storage: int64(0), + }, + "c6g.2xlarge": { + CPU: int64(8), + MaxPodsPerNode: int64(0), + Storage: int64(0), + }, + "c6g.4xlarge": { + CPU: int64(16), + MaxPodsPerNode: int64(0), + Storage: int64(0), + }, + "c6g.8xlarge": { + CPU: int64(32), + MaxPodsPerNode: int64(0), + Storage: int64(0), + }, + "c6g.large": { + CPU: int64(2), + MaxPodsPerNode: int64(0), + Storage: int64(0), + }, + "c6g.medium": { + CPU: int64(1), + MaxPodsPerNode: int64(0), + Storage: int64(0), + }, + "c6g.metal": { + CPU: int64(64), + MaxPodsPerNode: int64(0), + Storage: int64(0), + }, + "c6g.xlarge": { + CPU: int64(4), + MaxPodsPerNode: int64(0), + Storage: int64(0), }, "cc2.8xlarge": { - CPU: int64(32), - Memory: int64(61952), - Storage: int64(3360), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(3360), }, "d2.2xlarge": { - CPU: int64(8), - Memory: int64(62464), - Storage: int64(12288), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(12288), }, "d2.4xlarge": { - CPU: int64(16), - Memory: int64(124928), - Storage: int64(24576), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(24576), }, "d2.8xlarge": { - CPU: int64(36), - Memory: int64(249856), - Storage: int64(49152), + CPU: int64(36), + MaxPodsPerNode: int64(234), + Storage: int64(49152), }, "d2.xlarge": { - CPU: int64(4), - Memory: int64(31232), - Storage: int64(6144), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(6144), }, "f1.16xlarge": { - CPU: int64(64), - Memory: int64(999424), - Storage: int64(3760), + CPU: int64(64), + MaxPodsPerNode: int64(242), + Storage: int64(3760), }, "f1.2xlarge": { - CPU: int64(8), - Memory: int64(124928), - Storage: int64(470), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(470), }, "f1.4xlarge": { - CPU: int64(16), - Memory: int64(249856), - Storage: int64(940), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(940), }, "g2.2xlarge": { - CPU: int64(8), - Memory: int64(15360), - Storage: int64(60), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(60), }, "g2.8xlarge": { - CPU: int64(32), - Memory: int64(61440), - Storage: int64(240), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(240), }, "g3.16xlarge": { - CPU: int64(64), - Memory: int64(499712), - Storage: int64(0), + CPU: int64(64), + MaxPodsPerNode: int64(452), + Storage: int64(0), }, "g3.4xlarge": { - CPU: int64(16), - Memory: int64(124928), - Storage: int64(0), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "g3.8xlarge": { - CPU: int64(32), - Memory: int64(249856), - Storage: int64(0), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "g3s.xlarge": { - CPU: int64(4), - Memory: int64(31232), - Storage: int64(0), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "g4dn.12xlarge": { - CPU: int64(48), - Memory: int64(196608), - Storage: int64(900), + CPU: int64(48), + MaxPodsPerNode: int64(234), + Storage: int64(900), }, "g4dn.16xlarge": { - CPU: int64(64), - Memory: int64(262144), - Storage: int64(900), + CPU: int64(64), + MaxPodsPerNode: int64(58), + Storage: int64(900), }, "g4dn.2xlarge": { - CPU: int64(8), - Memory: int64(32768), - Storage: int64(225), + CPU: int64(8), + MaxPodsPerNode: int64(29), + Storage: int64(225), }, "g4dn.4xlarge": { - CPU: int64(16), - Memory: int64(65536), - Storage: int64(225), + CPU: int64(16), + MaxPodsPerNode: int64(29), + Storage: int64(225), }, "g4dn.8xlarge": { - CPU: int64(32), - Memory: int64(131072), - Storage: int64(900), + CPU: int64(32), + MaxPodsPerNode: int64(58), + Storage: int64(900), }, "g4dn.metal": { - CPU: int64(96), - Memory: int64(393216), - Storage: int64(1800), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(1800), }, "g4dn.xlarge": { - CPU: int64(4), - Memory: int64(16384), - Storage: int64(125), + CPU: int64(4), + MaxPodsPerNode: int64(29), + Storage: int64(125), }, "h1.16xlarge": { - CPU: int64(64), - Memory: int64(262144), - Storage: int64(16000), + CPU: int64(64), + MaxPodsPerNode: int64(452), + Storage: int64(16000), }, "h1.2xlarge": { - CPU: int64(8), - Memory: int64(32768), - Storage: int64(2000), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(2000), }, "h1.4xlarge": { - CPU: int64(16), - Memory: int64(65536), - Storage: int64(4000), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(4000), }, "h1.8xlarge": { - CPU: int64(32), - Memory: int64(131072), - Storage: int64(8000), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(8000), }, "i2.2xlarge": { - CPU: int64(8), - Memory: int64(62464), - Storage: int64(1600), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(1600), }, "i2.4xlarge": { - CPU: int64(16), - Memory: int64(124928), - Storage: int64(3200), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(3200), }, "i2.8xlarge": { - CPU: int64(32), - Memory: int64(249856), - Storage: int64(6400), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(6400), }, "i2.xlarge": { - CPU: int64(4), - Memory: int64(31232), - Storage: int64(800), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(800), }, "i3.16xlarge": { - CPU: int64(64), - Memory: int64(499712), - Storage: int64(15200), + CPU: int64(64), + MaxPodsPerNode: int64(452), + Storage: int64(15200), }, "i3.2xlarge": { - CPU: int64(8), - Memory: int64(62464), - Storage: int64(1900), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(1900), }, "i3.4xlarge": { - CPU: int64(16), - Memory: int64(124928), - Storage: int64(3800), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(3800), }, "i3.8xlarge": { - CPU: int64(32), - Memory: int64(249856), - Storage: int64(7600), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(7600), }, "i3.large": { - CPU: int64(2), - Memory: int64(15616), - Storage: int64(475), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(475), }, "i3.metal": { - CPU: int64(72), - Memory: int64(524288), - Storage: int64(15200), + CPU: int64(72), + MaxPodsPerNode: int64(737), + Storage: int64(15200), }, "i3.xlarge": { - CPU: int64(4), - Memory: int64(31232), - Storage: int64(950), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(950), }, "i3en.12xlarge": { - CPU: int64(48), - Memory: int64(393216), - Storage: int64(30000), + CPU: int64(48), + MaxPodsPerNode: int64(234), + Storage: int64(30000), }, "i3en.24xlarge": { - CPU: int64(96), - Memory: int64(786432), - Storage: int64(60000), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(60000), }, "i3en.2xlarge": { - CPU: int64(8), - Memory: int64(65536), - Storage: int64(5000), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(5000), }, "i3en.3xlarge": { - CPU: int64(12), - Memory: int64(98304), - Storage: int64(7500), + CPU: int64(12), + MaxPodsPerNode: int64(58), + Storage: int64(7500), }, "i3en.6xlarge": { - CPU: int64(24), - Memory: int64(196608), - Storage: int64(15000), + CPU: int64(24), + MaxPodsPerNode: int64(234), + Storage: int64(15000), }, "i3en.large": { - CPU: int64(2), - Memory: int64(16384), - Storage: int64(1250), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(1250), }, "i3en.metal": { - CPU: int64(96), - Memory: int64(786432), - Storage: int64(60000), + CPU: int64(96), + MaxPodsPerNode: int64(0), + Storage: int64(60000), }, "i3en.xlarge": { - CPU: int64(4), - Memory: int64(32768), - Storage: int64(2500), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(2500), }, "inf1.24xlarge": { - CPU: int64(96), - Memory: int64(196608), - Storage: int64(0), + CPU: int64(96), + MaxPodsPerNode: int64(437), + Storage: int64(0), }, "inf1.2xlarge": { - CPU: int64(8), - Memory: int64(16384), - Storage: int64(0), + CPU: int64(8), + MaxPodsPerNode: int64(38), + Storage: int64(0), }, "inf1.6xlarge": { - CPU: int64(24), - Memory: int64(49152), - Storage: int64(0), + CPU: int64(24), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "inf1.xlarge": { - CPU: int64(4), - Memory: int64(8192), - Storage: int64(0), + CPU: int64(4), + MaxPodsPerNode: int64(38), + Storage: int64(0), }, "m1.large": { - CPU: int64(2), - Memory: int64(7680), - Storage: int64(840), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(840), }, "m1.medium": { - CPU: int64(1), - Memory: int64(3788), - Storage: int64(410), + CPU: int64(1), + MaxPodsPerNode: int64(12), + Storage: int64(410), }, "m1.small": { - CPU: int64(1), - Memory: int64(1740), - Storage: int64(160), + CPU: int64(1), + MaxPodsPerNode: int64(8), + Storage: int64(160), }, "m1.xlarge": { - CPU: int64(4), - Memory: int64(15360), - Storage: int64(1680), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(1680), }, "m2.2xlarge": { - CPU: int64(4), - Memory: int64(35020), - Storage: int64(850), + CPU: int64(4), + MaxPodsPerNode: int64(118), + Storage: int64(850), }, "m2.4xlarge": { - CPU: int64(8), - Memory: int64(70041), - Storage: int64(1680), + CPU: int64(8), + MaxPodsPerNode: int64(234), + Storage: int64(1680), }, "m2.xlarge": { - CPU: int64(2), - Memory: int64(17510), - Storage: int64(420), + CPU: int64(2), + MaxPodsPerNode: int64(58), + Storage: int64(420), }, "m3.2xlarge": { - CPU: int64(8), - Memory: int64(30720), - Storage: int64(160), + CPU: int64(8), + MaxPodsPerNode: int64(118), + Storage: int64(160), }, "m3.large": { - CPU: int64(2), - Memory: int64(7680), - Storage: int64(32), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(32), }, "m3.medium": { - CPU: int64(1), - Memory: int64(3840), - Storage: int64(4), + CPU: int64(1), + MaxPodsPerNode: int64(12), + Storage: int64(4), }, "m3.xlarge": { - CPU: int64(4), - Memory: int64(15360), - Storage: int64(80), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(80), }, "m4.10xlarge": { - CPU: int64(40), - Memory: int64(163840), - Storage: int64(0), + CPU: int64(40), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "m4.16xlarge": { - CPU: int64(64), - Memory: int64(262144), - Storage: int64(0), + CPU: int64(64), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "m4.2xlarge": { - CPU: int64(8), - Memory: int64(32768), - Storage: int64(0), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "m4.4xlarge": { - CPU: int64(16), - Memory: int64(65536), - Storage: int64(0), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "m4.large": { - CPU: int64(2), - Memory: int64(8192), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(20), + Storage: int64(0), }, "m4.xlarge": { - CPU: int64(4), - Memory: int64(16384), - Storage: int64(0), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "m5.12xlarge": { - CPU: int64(48), - Memory: int64(196608), - Storage: int64(0), + CPU: int64(48), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "m5.16xlarge": { - CPU: int64(64), - Memory: int64(262144), - Storage: int64(0), + CPU: int64(64), + MaxPodsPerNode: int64(737), + Storage: int64(0), }, "m5.24xlarge": { - CPU: int64(96), - Memory: int64(393216), - Storage: int64(0), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(0), }, "m5.2xlarge": { - CPU: int64(8), - Memory: int64(32768), - Storage: int64(0), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "m5.4xlarge": { - CPU: int64(16), - Memory: int64(65536), - Storage: int64(0), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "m5.8xlarge": { - CPU: int64(32), - Memory: int64(131072), - Storage: int64(0), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "m5.large": { - CPU: int64(2), - Memory: int64(8192), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(0), }, "m5.metal": { - CPU: int64(96), - Memory: int64(393216), - Storage: int64(0), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(0), }, "m5.xlarge": { - CPU: int64(4), - Memory: int64(16384), - Storage: int64(0), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "m5a.12xlarge": { - CPU: int64(48), - Memory: int64(196608), - Storage: int64(0), + CPU: int64(48), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "m5a.16xlarge": { - CPU: int64(64), - Memory: int64(262144), - Storage: int64(0), + CPU: int64(64), + MaxPodsPerNode: int64(737), + Storage: int64(0), }, "m5a.24xlarge": { - CPU: int64(96), - Memory: int64(393216), - Storage: int64(0), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(0), }, "m5a.2xlarge": { - CPU: int64(8), - Memory: int64(32768), - Storage: int64(0), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "m5a.4xlarge": { - CPU: int64(16), - Memory: int64(65536), - Storage: int64(0), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "m5a.8xlarge": { - CPU: int64(32), - Memory: int64(131072), - Storage: int64(0), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "m5a.large": { - CPU: int64(2), - Memory: int64(8192), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(0), }, "m5a.xlarge": { - CPU: int64(4), - Memory: int64(16384), - Storage: int64(0), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "m5ad.12xlarge": { - CPU: int64(48), - Memory: int64(196608), - Storage: int64(1800), + CPU: int64(48), + MaxPodsPerNode: int64(234), + Storage: int64(1800), }, "m5ad.16xlarge": { - CPU: int64(64), - Memory: int64(262144), - Storage: int64(2400), + CPU: int64(64), + MaxPodsPerNode: int64(0), + Storage: int64(2400), }, "m5ad.24xlarge": { - CPU: int64(96), - Memory: int64(393216), - Storage: int64(3600), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(3600), }, "m5ad.2xlarge": { - CPU: int64(8), - Memory: int64(32768), - Storage: int64(300), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(300), }, "m5ad.4xlarge": { - CPU: int64(16), - Memory: int64(65536), - Storage: int64(600), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(600), }, "m5ad.8xlarge": { - CPU: int64(32), - Memory: int64(131072), - Storage: int64(1200), + CPU: int64(32), + MaxPodsPerNode: int64(0), + Storage: int64(1200), }, "m5ad.large": { - CPU: int64(2), - Memory: int64(8192), - Storage: int64(75), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(75), }, "m5ad.xlarge": { - CPU: int64(4), - Memory: int64(16384), - Storage: int64(150), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(150), }, "m5d.12xlarge": { - CPU: int64(48), - Memory: int64(196608), - Storage: int64(1800), + CPU: int64(48), + MaxPodsPerNode: int64(234), + Storage: int64(1800), }, "m5d.16xlarge": { - CPU: int64(64), - Memory: int64(262144), - Storage: int64(2400), + CPU: int64(64), + MaxPodsPerNode: int64(737), + Storage: int64(2400), }, "m5d.24xlarge": { - CPU: int64(96), - Memory: int64(393216), - Storage: int64(3600), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(3600), }, "m5d.2xlarge": { - CPU: int64(8), - Memory: int64(32768), - Storage: int64(300), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(300), }, "m5d.4xlarge": { - CPU: int64(16), - Memory: int64(65536), - Storage: int64(600), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(600), }, "m5d.8xlarge": { - CPU: int64(32), - Memory: int64(131072), - Storage: int64(1200), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(1200), }, "m5d.large": { - CPU: int64(2), - Memory: int64(8192), - Storage: int64(75), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(75), }, "m5d.metal": { - CPU: int64(96), - Memory: int64(393216), - Storage: int64(3600), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(3600), }, "m5d.xlarge": { - CPU: int64(4), - Memory: int64(16384), - Storage: int64(150), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(150), }, "m5dn.12xlarge": { - CPU: int64(48), - Memory: int64(196608), - Storage: int64(1800), + CPU: int64(48), + MaxPodsPerNode: int64(234), + Storage: int64(1800), }, "m5dn.16xlarge": { - CPU: int64(64), - Memory: int64(262144), - Storage: int64(2400), + CPU: int64(64), + MaxPodsPerNode: int64(737), + Storage: int64(2400), }, "m5dn.24xlarge": { - CPU: int64(96), - Memory: int64(393216), - Storage: int64(3600), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(3600), }, "m5dn.2xlarge": { - CPU: int64(8), - Memory: int64(32768), - Storage: int64(300), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(300), }, "m5dn.4xlarge": { - CPU: int64(16), - Memory: int64(65536), - Storage: int64(600), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(600), }, "m5dn.8xlarge": { - CPU: int64(32), - Memory: int64(131072), - Storage: int64(1200), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(1200), }, "m5dn.large": { - CPU: int64(2), - Memory: int64(8192), - Storage: int64(75), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(75), }, "m5dn.xlarge": { - CPU: int64(4), - Memory: int64(16384), - Storage: int64(150), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(150), }, "m5n.12xlarge": { - CPU: int64(48), - Memory: int64(196608), - Storage: int64(0), + CPU: int64(48), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "m5n.16xlarge": { - CPU: int64(64), - Memory: int64(262144), - Storage: int64(0), + CPU: int64(64), + MaxPodsPerNode: int64(737), + Storage: int64(0), }, "m5n.24xlarge": { - CPU: int64(96), - Memory: int64(393216), - Storage: int64(0), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(0), }, "m5n.2xlarge": { - CPU: int64(8), - Memory: int64(32768), - Storage: int64(0), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "m5n.4xlarge": { - CPU: int64(16), - Memory: int64(65536), - Storage: int64(0), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "m5n.8xlarge": { - CPU: int64(32), - Memory: int64(131072), - Storage: int64(0), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "m5n.large": { - CPU: int64(2), - Memory: int64(8192), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(0), }, "m5n.xlarge": { - CPU: int64(4), - Memory: int64(16384), - Storage: int64(0), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(0), + }, + "m6g.12xlarge": { + CPU: int64(48), + MaxPodsPerNode: int64(234), + Storage: int64(0), + }, + "m6g.16xlarge": { + CPU: int64(64), + MaxPodsPerNode: int64(737), + Storage: int64(0), + }, + "m6g.2xlarge": { + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(0), + }, + "m6g.4xlarge": { + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(0), + }, + "m6g.8xlarge": { + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(0), + }, + "m6g.large": { + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(0), + }, + "m6g.medium": { + CPU: int64(1), + MaxPodsPerNode: int64(8), + Storage: int64(0), + }, + "m6g.metal": { + CPU: int64(64), + MaxPodsPerNode: int64(0), + Storage: int64(0), + }, + "m6g.xlarge": { + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "p2.16xlarge": { - CPU: int64(64), - Memory: int64(749568), - Storage: int64(0), + CPU: int64(64), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "p2.8xlarge": { - CPU: int64(32), - Memory: int64(499712), - Storage: int64(0), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "p2.xlarge": { - CPU: int64(4), - Memory: int64(62464), - Storage: int64(0), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "p3.16xlarge": { - CPU: int64(64), - Memory: int64(499712), - Storage: int64(0), + CPU: int64(64), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "p3.2xlarge": { - CPU: int64(8), - Memory: int64(62464), - Storage: int64(0), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "p3.8xlarge": { - CPU: int64(32), - Memory: int64(249856), - Storage: int64(0), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "p3dn.24xlarge": { - CPU: int64(96), - Memory: int64(786432), - Storage: int64(1800), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(1800), }, "r3.2xlarge": { - CPU: int64(8), - Memory: int64(62464), - Storage: int64(160), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(160), }, "r3.4xlarge": { - CPU: int64(16), - Memory: int64(124928), - Storage: int64(320), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(320), }, "r3.8xlarge": { - CPU: int64(32), - Memory: int64(249856), - Storage: int64(640), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(640), }, "r3.large": { - CPU: int64(2), - Memory: int64(15360), - Storage: int64(32), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(32), }, "r3.xlarge": { - CPU: int64(4), - Memory: int64(31232), - Storage: int64(80), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(80), }, "r4.16xlarge": { - CPU: int64(64), - Memory: int64(499712), - Storage: int64(0), + CPU: int64(64), + MaxPodsPerNode: int64(452), + Storage: int64(0), }, "r4.2xlarge": { - CPU: int64(8), - Memory: int64(62464), - Storage: int64(0), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "r4.4xlarge": { - CPU: int64(16), - Memory: int64(124928), - Storage: int64(0), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "r4.8xlarge": { - CPU: int64(32), - Memory: int64(249856), - Storage: int64(0), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "r4.large": { - CPU: int64(2), - Memory: int64(15616), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(0), }, "r4.xlarge": { - CPU: int64(4), - Memory: int64(31232), - Storage: int64(0), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "r5.12xlarge": { - CPU: int64(48), - Memory: int64(393216), - Storage: int64(0), + CPU: int64(48), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "r5.16xlarge": { - CPU: int64(64), - Memory: int64(524288), - Storage: int64(0), + CPU: int64(64), + MaxPodsPerNode: int64(737), + Storage: int64(0), }, "r5.24xlarge": { - CPU: int64(96), - Memory: int64(786432), - Storage: int64(0), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(0), }, "r5.2xlarge": { - CPU: int64(8), - Memory: int64(65536), - Storage: int64(0), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "r5.4xlarge": { - CPU: int64(16), - Memory: int64(131072), - Storage: int64(0), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "r5.8xlarge": { - CPU: int64(32), - Memory: int64(262144), - Storage: int64(0), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "r5.large": { - CPU: int64(2), - Memory: int64(16384), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(0), }, "r5.metal": { - CPU: int64(96), - Memory: int64(786432), - Storage: int64(0), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(0), }, "r5.xlarge": { - CPU: int64(4), - Memory: int64(32768), - Storage: int64(0), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "r5a.12xlarge": { - CPU: int64(48), - Memory: int64(393216), - Storage: int64(0), + CPU: int64(48), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "r5a.16xlarge": { - CPU: int64(64), - Memory: int64(524288), - Storage: int64(0), + CPU: int64(64), + MaxPodsPerNode: int64(737), + Storage: int64(0), }, "r5a.24xlarge": { - CPU: int64(96), - Memory: int64(786432), - Storage: int64(0), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(0), }, "r5a.2xlarge": { - CPU: int64(8), - Memory: int64(65536), - Storage: int64(0), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "r5a.4xlarge": { - CPU: int64(16), - Memory: int64(131072), - Storage: int64(0), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "r5a.8xlarge": { - CPU: int64(32), - Memory: int64(262144), - Storage: int64(0), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "r5a.large": { - CPU: int64(2), - Memory: int64(16384), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(0), }, "r5a.xlarge": { - CPU: int64(4), - Memory: int64(32768), - Storage: int64(0), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "r5ad.12xlarge": { - CPU: int64(48), - Memory: int64(393216), - Storage: int64(1800), + CPU: int64(48), + MaxPodsPerNode: int64(234), + Storage: int64(1800), }, "r5ad.16xlarge": { - CPU: int64(64), - Memory: int64(524288), - Storage: int64(2400), + CPU: int64(64), + MaxPodsPerNode: int64(0), + Storage: int64(2400), }, "r5ad.24xlarge": { - CPU: int64(96), - Memory: int64(786432), - Storage: int64(3600), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(3600), }, "r5ad.2xlarge": { - CPU: int64(8), - Memory: int64(65536), - Storage: int64(300), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(300), }, "r5ad.4xlarge": { - CPU: int64(16), - Memory: int64(131072), - Storage: int64(600), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(600), }, "r5ad.8xlarge": { - CPU: int64(32), - Memory: int64(262144), - Storage: int64(1200), + CPU: int64(32), + MaxPodsPerNode: int64(0), + Storage: int64(1200), }, "r5ad.large": { - CPU: int64(2), - Memory: int64(16384), - Storage: int64(75), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(75), }, "r5ad.xlarge": { - CPU: int64(4), - Memory: int64(32768), - Storage: int64(150), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(150), }, "r5d.12xlarge": { - CPU: int64(48), - Memory: int64(393216), - Storage: int64(1800), + CPU: int64(48), + MaxPodsPerNode: int64(234), + Storage: int64(1800), }, "r5d.16xlarge": { - CPU: int64(64), - Memory: int64(524288), - Storage: int64(2400), + CPU: int64(64), + MaxPodsPerNode: int64(737), + Storage: int64(2400), }, "r5d.24xlarge": { - CPU: int64(96), - Memory: int64(786432), - Storage: int64(3600), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(3600), }, "r5d.2xlarge": { - CPU: int64(8), - Memory: int64(65536), - Storage: int64(300), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(300), }, "r5d.4xlarge": { - CPU: int64(16), - Memory: int64(131072), - Storage: int64(600), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(600), }, "r5d.8xlarge": { - CPU: int64(32), - Memory: int64(262144), - Storage: int64(1200), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(1200), }, "r5d.large": { - CPU: int64(2), - Memory: int64(16384), - Storage: int64(75), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(75), }, "r5d.metal": { - CPU: int64(96), - Memory: int64(786432), - Storage: int64(3600), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(3600), }, "r5d.xlarge": { - CPU: int64(4), - Memory: int64(32768), - Storage: int64(150), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(150), }, "r5dn.12xlarge": { - CPU: int64(48), - Memory: int64(393216), - Storage: int64(1800), + CPU: int64(48), + MaxPodsPerNode: int64(234), + Storage: int64(1800), }, "r5dn.16xlarge": { - CPU: int64(64), - Memory: int64(524288), - Storage: int64(2400), + CPU: int64(64), + MaxPodsPerNode: int64(737), + Storage: int64(2400), }, "r5dn.24xlarge": { - CPU: int64(96), - Memory: int64(786432), - Storage: int64(3600), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(3600), }, "r5dn.2xlarge": { - CPU: int64(8), - Memory: int64(65536), - Storage: int64(300), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(300), }, "r5dn.4xlarge": { - CPU: int64(16), - Memory: int64(131072), - Storage: int64(600), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(600), }, "r5dn.8xlarge": { - CPU: int64(32), - Memory: int64(262144), - Storage: int64(1200), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(1200), }, "r5dn.large": { - CPU: int64(2), - Memory: int64(16384), - Storage: int64(75), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(75), }, "r5dn.xlarge": { - CPU: int64(4), - Memory: int64(32768), - Storage: int64(150), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(150), }, "r5n.12xlarge": { - CPU: int64(48), - Memory: int64(393216), - Storage: int64(0), + CPU: int64(48), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "r5n.16xlarge": { - CPU: int64(64), - Memory: int64(524288), - Storage: int64(0), + CPU: int64(64), + MaxPodsPerNode: int64(737), + Storage: int64(0), }, "r5n.24xlarge": { - CPU: int64(96), - Memory: int64(786432), - Storage: int64(0), + CPU: int64(96), + MaxPodsPerNode: int64(737), + Storage: int64(0), }, "r5n.2xlarge": { - CPU: int64(8), - Memory: int64(65536), - Storage: int64(0), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "r5n.4xlarge": { - CPU: int64(16), - Memory: int64(131072), - Storage: int64(0), + CPU: int64(16), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "r5n.8xlarge": { - CPU: int64(32), - Memory: int64(262144), - Storage: int64(0), + CPU: int64(32), + MaxPodsPerNode: int64(234), + Storage: int64(0), }, "r5n.large": { - CPU: int64(2), - Memory: int64(16384), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(0), }, "r5n.xlarge": { - CPU: int64(4), - Memory: int64(32768), - Storage: int64(0), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(0), + }, + "r6g.12xlarge": { + CPU: int64(48), + MaxPodsPerNode: int64(0), + Storage: int64(0), + }, + "r6g.16xlarge": { + CPU: int64(64), + MaxPodsPerNode: int64(0), + Storage: int64(0), + }, + "r6g.2xlarge": { + CPU: int64(8), + MaxPodsPerNode: int64(0), + Storage: int64(0), + }, + "r6g.4xlarge": { + CPU: int64(16), + MaxPodsPerNode: int64(0), + Storage: int64(0), + }, + "r6g.8xlarge": { + CPU: int64(32), + MaxPodsPerNode: int64(0), + Storage: int64(0), + }, + "r6g.large": { + CPU: int64(2), + MaxPodsPerNode: int64(0), + Storage: int64(0), + }, + "r6g.medium": { + CPU: int64(1), + MaxPodsPerNode: int64(0), + Storage: int64(0), + }, + "r6g.metal": { + CPU: int64(64), + MaxPodsPerNode: int64(0), + Storage: int64(0), + }, + "r6g.xlarge": { + CPU: int64(4), + MaxPodsPerNode: int64(0), + Storage: int64(0), }, "t1.micro": { - CPU: int64(1), - Memory: int64(627), - Storage: int64(0), + CPU: int64(1), + MaxPodsPerNode: int64(4), + Storage: int64(0), }, "t2.2xlarge": { - CPU: int64(8), - Memory: int64(32768), - Storage: int64(0), + CPU: int64(8), + MaxPodsPerNode: int64(44), + Storage: int64(0), }, "t2.large": { - CPU: int64(2), - Memory: int64(8192), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(35), + Storage: int64(0), }, "t2.medium": { - CPU: int64(2), - Memory: int64(4096), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(17), + Storage: int64(0), }, "t2.micro": { - CPU: int64(1), - Memory: int64(1024), - Storage: int64(0), + CPU: int64(1), + MaxPodsPerNode: int64(4), + Storage: int64(0), }, "t2.nano": { - CPU: int64(1), - Memory: int64(512), - Storage: int64(0), + CPU: int64(1), + MaxPodsPerNode: int64(4), + Storage: int64(0), }, "t2.small": { - CPU: int64(1), - Memory: int64(2048), - Storage: int64(0), + CPU: int64(1), + MaxPodsPerNode: int64(11), + Storage: int64(0), }, "t2.xlarge": { - CPU: int64(4), - Memory: int64(16384), - Storage: int64(0), + CPU: int64(4), + MaxPodsPerNode: int64(44), + Storage: int64(0), }, "t3.2xlarge": { - CPU: int64(8), - Memory: int64(32768), - Storage: int64(0), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "t3.large": { - CPU: int64(2), - Memory: int64(8192), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(35), + Storage: int64(0), }, "t3.medium": { - CPU: int64(2), - Memory: int64(4096), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(17), + Storage: int64(0), }, "t3.micro": { - CPU: int64(2), - Memory: int64(1024), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(4), + Storage: int64(0), }, "t3.nano": { - CPU: int64(2), - Memory: int64(512), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(4), + Storage: int64(0), }, "t3.small": { - CPU: int64(2), - Memory: int64(2048), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(11), + Storage: int64(0), }, "t3.xlarge": { - CPU: int64(4), - Memory: int64(16384), - Storage: int64(0), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "t3a.2xlarge": { - CPU: int64(8), - Memory: int64(32768), - Storage: int64(0), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "t3a.large": { - CPU: int64(2), - Memory: int64(8192), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(35), + Storage: int64(0), }, "t3a.medium": { - CPU: int64(2), - Memory: int64(4096), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(17), + Storage: int64(0), }, "t3a.micro": { - CPU: int64(2), - Memory: int64(1024), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(4), + Storage: int64(0), }, "t3a.nano": { - CPU: int64(2), - Memory: int64(512), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(4), + Storage: int64(0), }, "t3a.small": { - CPU: int64(2), - Memory: int64(2048), - Storage: int64(0), + CPU: int64(2), + MaxPodsPerNode: int64(8), + Storage: int64(0), }, "t3a.xlarge": { - CPU: int64(4), - Memory: int64(16384), - Storage: int64(0), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(0), }, "x1.16xlarge": { - CPU: int64(64), - Memory: int64(999424), - Storage: int64(1920), + CPU: int64(64), + MaxPodsPerNode: int64(234), + Storage: int64(1920), }, "x1.32xlarge": { - CPU: int64(128), - Memory: int64(1998848), - Storage: int64(3840), + CPU: int64(128), + MaxPodsPerNode: int64(234), + Storage: int64(3840), }, "x1e.16xlarge": { - CPU: int64(64), - Memory: int64(1998848), - Storage: int64(1920), + CPU: int64(64), + MaxPodsPerNode: int64(234), + Storage: int64(1920), }, "x1e.2xlarge": { - CPU: int64(8), - Memory: int64(249856), - Storage: int64(240), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(240), }, "x1e.32xlarge": { - CPU: int64(128), - Memory: int64(3997696), - Storage: int64(3840), + CPU: int64(128), + MaxPodsPerNode: int64(234), + Storage: int64(3840), }, "x1e.4xlarge": { - CPU: int64(16), - Memory: int64(499712), - Storage: int64(480), + CPU: int64(16), + MaxPodsPerNode: int64(58), + Storage: int64(480), }, "x1e.8xlarge": { - CPU: int64(32), - Memory: int64(999424), - Storage: int64(960), + CPU: int64(32), + MaxPodsPerNode: int64(58), + Storage: int64(960), }, "x1e.xlarge": { - CPU: int64(4), - Memory: int64(124928), - Storage: int64(120), + CPU: int64(4), + MaxPodsPerNode: int64(29), + Storage: int64(120), }, "z1d.12xlarge": { - CPU: int64(48), - Memory: int64(393216), - Storage: int64(1800), + CPU: int64(48), + MaxPodsPerNode: int64(737), + Storage: int64(1800), }, "z1d.2xlarge": { - CPU: int64(8), - Memory: int64(65536), - Storage: int64(300), + CPU: int64(8), + MaxPodsPerNode: int64(58), + Storage: int64(300), }, "z1d.3xlarge": { - CPU: int64(12), - Memory: int64(98304), - Storage: int64(450), + CPU: int64(12), + MaxPodsPerNode: int64(234), + Storage: int64(450), }, "z1d.6xlarge": { - CPU: int64(24), - Memory: int64(196608), - Storage: int64(900), + CPU: int64(24), + MaxPodsPerNode: int64(234), + Storage: int64(900), }, "z1d.large": { - CPU: int64(2), - Memory: int64(16384), - Storage: int64(75), + CPU: int64(2), + MaxPodsPerNode: int64(29), + Storage: int64(75), }, "z1d.metal": { - CPU: int64(48), - Memory: int64(393216), - Storage: int64(1800), + CPU: int64(48), + MaxPodsPerNode: int64(737), + Storage: int64(1800), }, "z1d.xlarge": { - CPU: int64(4), - Memory: int64(32768), - Storage: int64(150), + CPU: int64(4), + MaxPodsPerNode: int64(58), + Storage: int64(150), }, } diff --git a/pkg/nodebootstrap/reserved_generate.go b/pkg/nodebootstrap/reserved_generate.go index bdd4eb199b..22bf488d38 100644 --- a/pkg/nodebootstrap/reserved_generate.go +++ b/pkg/nodebootstrap/reserved_generate.go @@ -90,9 +90,9 @@ func render(infos map[string]nodebootstrap.InstanceTypeInfo) error { Map(String()).Id("InstanceTypeInfo").Values(DictFunc(func(d Dict) { for k, info := range infos { d[Lit(k)] = Values(Dict{ - Id("Storage"): Lit(info.Storage), - Id("Memory"): Lit(info.Memory), - Id("CPU"): Lit(info.CPU), + Id("Storage"): Lit(info.Storage), + Id("MaxPodsPerNode"): Lit(info.MaxPodsPerNode), + Id("CPU"): Lit(info.CPU), }) } })) diff --git a/pkg/nodebootstrap/reserved_test.go b/pkg/nodebootstrap/reserved_test.go index 704966f594..7ca2f0c220 100644 --- a/pkg/nodebootstrap/reserved_test.go +++ b/pkg/nodebootstrap/reserved_test.go @@ -21,20 +21,19 @@ var _ = Describe("Reservations defaults", func() { ) type memoryCase struct { - mib int64 - exp string + maxPodsPerNode int64 + exp string } DescribeTable("calculate memory", func(c memoryCase) { - Expect(InstanceTypeInfo{Memory: c.mib}.DefaultMemoryToReserve()).To(Equal(c.exp)) + Expect(InstanceTypeInfo{MaxPodsPerNode: c.maxPodsPerNode}.DefaultMemoryToReserve()).To(Equal(c.exp)) }, - Entry("0MiB", memoryCase{0, "255Mi"}), - Entry("512MiB", memoryCase{512, "255Mi"}), - Entry("2GiB", memoryCase{2048, "512Mi"}), - Entry("4GiB", memoryCase{4096, "1024Mi"}), - Entry("6GiB", memoryCase{6144, "1433Mi"}), - Entry("8GiB", memoryCase{8192, "1843Mi"}), - Entry("12GiB", memoryCase{12288, "2252Mi"}), - Entry("64GiB", memoryCase{1 << 16, "5611Mi"}), + Entry("4 pods per node", memoryCase{4, "299Mi"}), + Entry("8 pods per node", memoryCase{8, "343Mi"}), + Entry("29 pods per node", memoryCase{29, "574Mi"}), + Entry("58 pods per node", memoryCase{58, "893Mi"}), + Entry("234 pods per node", memoryCase{234, "2829Mi"}), + Entry("452 pods per node", memoryCase{452, "5227Mi"}), + Entry("737 pods per node", memoryCase{737, "8362Mi"}), ) type cpuCase struct { @@ -68,17 +67,15 @@ var _ = Describe("Reservations defaults", func() { Expect(instanceTypeInfos[c.instance].DefaultMemoryToReserve()).To(Equal(c.expMemory)) Expect(instanceTypeInfos[c.instance].DefaultCPUToReserve()).To(Equal(c.expCPU)) }, - Entry("a1.2xlarge", instanceCase{"a1.2xlarge", "2662Mi", "90m", "1Gi"}), - Entry("t3.nano", instanceCase{"t3.nano", "255Mi", "70m", "1Gi"}), - Entry("t3a.micro", instanceCase{"t3a.micro", "256Mi", "70m", "1Gi"}), - Entry("t2.small", instanceCase{"t2.small", "512Mi", "60m", "1Gi"}), - Entry("t2.medium", instanceCase{"t2.medium", "1024Mi", "70m", "1Gi"}), - Entry("m5ad.large", instanceCase{"m5ad.large", "1843Mi", "70m", "1Gi"}), - Entry("m5ad", instanceCase{"m5ad.xlarge", "2662Mi", "80m", "1Gi"}), - Entry("m5ad.2xlarge", instanceCase{"m5ad.2xlarge", "3645Mi", "90m", "1Gi"}), - Entry("m5ad.8xlarge", instanceCase{"m5ad.8xlarge", "9543Mi", "150m", "1Gi"}), - Entry("m5ad.12xlarge", instanceCase{"m5ad.12xlarge", "10853Mi", "190m", "1Gi"}), - Entry("m5ad.16xlarge", instanceCase{"m5ad.16xlarge", "12164Mi", "230m", "1Gi"}), - Entry("m5ad.24xlarge", instanceCase{"m5ad.24xlarge", "14785Mi", "310m", "1Gi"}), + Entry("a1.2xlarge", instanceCase{"a1.2xlarge", "893Mi", "90m", "1Gi"}), + Entry("t3.nano", instanceCase{"t3.nano", "299Mi", "70m", "1Gi"}), + Entry("t3a.micro", instanceCase{"t3a.micro", "299Mi", "70m", "1Gi"}), + Entry("t2.small", instanceCase{"t2.small", "376Mi", "60m", "1Gi"}), + Entry("t2.medium", instanceCase{"t2.medium", "442Mi", "70m", "1Gi"}), + Entry("m5ad.large", instanceCase{"m5ad.large", "574Mi", "70m", "1Gi"}), + Entry("m5ad.xlarge", instanceCase{"m5ad.xlarge", "893Mi", "80m", "1Gi"}), + Entry("m5ad.2xlarge", instanceCase{"m5ad.2xlarge", "893Mi", "90m", "1Gi"}), + Entry("m5ad.12xlarge", instanceCase{"m5ad.12xlarge", "2829Mi", "190m", "1Gi"}), + Entry("m5ad.24xlarge", instanceCase{"m5ad.24xlarge", "8362Mi", "310m", "1Gi"}), ) }) diff --git a/pkg/nodebootstrap/userdata.go b/pkg/nodebootstrap/userdata.go index b39cdcd882..eb054ad6ec 100644 --- a/pkg/nodebootstrap/userdata.go +++ b/pkg/nodebootstrap/userdata.go @@ -125,21 +125,21 @@ func makeKubeletConfigYAML(spec *api.ClusterConfig, ng *api.NodeGroup) ([]byte, obj["kubeReserved"] = getKubeReserved(info) } else if ng.InstancesDistribution != nil { // This is a NodeGroup using mixed instance types - var minCPU, minRAM int64 + var minCPU, minMaxPodsPerNode int64 for _, instanceType := range ng.InstancesDistribution.InstanceTypes { if info, ok := instanceTypeInfos[instanceType]; ok { if instanceCPU := info.CPU; minCPU == 0 || instanceCPU < minCPU { minCPU = instanceCPU } - if instanceRAM := info.Memory; minRAM == 0 || instanceRAM < minRAM { - minRAM = instanceRAM + if instanceMaxPodsPerNode := info.MaxPodsPerNode; minMaxPodsPerNode == 0 || instanceMaxPodsPerNode < minMaxPodsPerNode { + minMaxPodsPerNode = instanceMaxPodsPerNode } } } - if minCPU > 0 && minRAM > 0 { + if minCPU > 0 && minMaxPodsPerNode > 0 { info = InstanceTypeInfo{ - Memory: minRAM, - CPU: minCPU, + MaxPodsPerNode: minMaxPodsPerNode, + CPU: minCPU, } if _, ok := obj["kubeReserved"]; !ok { obj["kubeReserved"] = api.InlineDocument{} diff --git a/pkg/nodebootstrap/userdata_test.go b/pkg/nodebootstrap/userdata_test.go index fceeeddd28..71df6ca7c3 100644 --- a/pkg/nodebootstrap/userdata_test.go +++ b/pkg/nodebootstrap/userdata_test.go @@ -70,7 +70,7 @@ var _ = Describe("User data", func() { Expect(kubelet.KubeReserved).To(Equal(map[string]string{ "ephemeral-storage": "1Gi", "cpu": "250m", - "memory": "17407Mi", + "memory": "8362Mi", })) }) @@ -78,9 +78,12 @@ var _ = Describe("User data", func() { ng.InstancesDistribution = &api.NodeGroupInstancesDistribution{} ng.InstancesDistribution.InstanceTypes = []string{ "c5.xlarge", - "c5.2xlarge", - "c5.4xlarge", + "c5a.2xlarge", + "c5a.4xlarge", } + Expect(instanceTypeExists(ng.InstancesDistribution.InstanceTypes[0])).To(Equal(true)) + Expect(instanceTypeExists(ng.InstancesDistribution.InstanceTypes[1])).To(Equal(true)) + Expect(instanceTypeExists(ng.InstancesDistribution.InstanceTypes[2])).To(Equal(true)) data, err := makeKubeletConfigYAML(clusterConfig, ng) Expect(err).ToNot(HaveOccurred()) @@ -90,7 +93,7 @@ var _ = Describe("User data", func() { Expect(kubelet.KubeReserved).To(Equal(map[string]string{ "ephemeral-storage": "1Gi", "cpu": "80m", - "memory": "1843Mi", + "memory": "893Mi", })) }) @@ -101,6 +104,9 @@ var _ = Describe("User data", func() { "dne.small", "dne.large", } + Expect(instanceTypeExists(ng.InstancesDistribution.InstanceTypes[0])).To(Equal(true)) + Expect(instanceTypeExists(ng.InstancesDistribution.InstanceTypes[1])).To(Equal(false)) + Expect(instanceTypeExists(ng.InstancesDistribution.InstanceTypes[2])).To(Equal(false)) data, err := makeKubeletConfigYAML(clusterConfig, ng) Expect(err).ToNot(HaveOccurred()) @@ -110,7 +116,7 @@ var _ = Describe("User data", func() { Expect(kubelet.KubeReserved).To(Equal(map[string]string{ "ephemeral-storage": "1Gi", "cpu": "80m", - "memory": "1843Mi", + "memory": "893Mi", })) }) @@ -158,9 +164,12 @@ var _ = Describe("User data", func() { ng.InstancesDistribution = &api.NodeGroupInstancesDistribution{} ng.InstancesDistribution.InstanceTypes = []string{ "c5.xlarge", - "c5.2xlarge", - "c5.4xlarge", + "c5a.2xlarge", + "c5a.4xlarge", } + Expect(instanceTypeExists(ng.InstancesDistribution.InstanceTypes[0])).To(Equal(true)) + Expect(instanceTypeExists(ng.InstancesDistribution.InstanceTypes[1])).To(Equal(true)) + Expect(instanceTypeExists(ng.InstancesDistribution.InstanceTypes[2])).To(Equal(true)) data, err := makeKubeletConfigYAML(clusterConfig, ng) Expect(err).ToNot(HaveOccurred()) @@ -179,3 +188,8 @@ var _ = Describe("User data", func() { }) }) }) + +func instanceTypeExists(name string) bool { + _, exists := instanceTypeInfos[name] + return exists +}