-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to using ec2.DescribeInstanceTypes for building the MachineTypes list #8847
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rifelpet The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This is super cool :). |
InstanceENIs: 15, | ||
InstanceIPsPerENI: 50, | ||
InstanceENIs: 4, | ||
InstanceIPsPerENI: 15, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a correct change based on the table here
@@ -949,14 +912,14 @@ var MachineTypes []AWSMachineTypeInfo = []AWSMachineTypeInfo{ | |||
MemoryGB: 192, | |||
Cores: 96, | |||
InstanceENIs: 15, | |||
InstanceIPsPerENI: 50, | |||
InstanceIPsPerENI: 30, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a correct change based on the table here
@@ -1170,7 +1133,7 @@ var MachineTypes []AWSMachineTypeInfo = []AWSMachineTypeInfo{ | |||
MemoryGB: 256, | |||
Cores: 64, | |||
InstanceENIs: 15, | |||
InstanceIPsPerENI: 30, | |||
InstanceIPsPerENI: 50, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a correct change based on the table here
@@ -1252,7 +1215,7 @@ var MachineTypes []AWSMachineTypeInfo = []AWSMachineTypeInfo{ | |||
MemoryGB: 256, | |||
Cores: 64, | |||
InstanceENIs: 15, | |||
InstanceIPsPerENI: 30, | |||
InstanceIPsPerENI: 50, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a correct change based on the table here
@@ -1380,7 +1343,7 @@ var MachineTypes []AWSMachineTypeInfo = []AWSMachineTypeInfo{ | |||
MemoryGB: 256, | |||
Cores: 64, | |||
InstanceENIs: 15, | |||
InstanceIPsPerENI: 30, | |||
InstanceIPsPerENI: 50, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a correct change based on the table here
@@ -2394,7 +2284,7 @@ var MachineTypes []AWSMachineTypeInfo = []AWSMachineTypeInfo{ | |||
Name: "t3a.small", | |||
MemoryGB: 2, | |||
Cores: 2, | |||
InstanceENIs: 3, | |||
InstanceENIs: 2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a correct change based on the table here
@@ -837,7 +800,7 @@ var MachineTypes []AWSMachineTypeInfo = []AWSMachineTypeInfo{ | |||
{ | |||
Name: "i3.metal", | |||
MemoryGB: 512, | |||
Cores: 64, | |||
Cores: 72, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The table here states "i3.metal provides 72 logical processors on 36 physical cores". So this is correct.
@@ -1697,7 +1587,7 @@ var MachineTypes []AWSMachineTypeInfo = []AWSMachineTypeInfo{ | |||
// r3 family | |||
{ | |||
Name: "r3.large", | |||
MemoryGB: 15.25, | |||
MemoryGB: 15, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The table here gives the 15.25 number.
Regarding some of these differences, I wouldn't be surprised if AWS is inconsistent in their many sources of this information. I'm tempted to round the MemoryGB fields to 2 decimal places. That would reduce the differences to just the With that, I'm not concerned about changes to the MemoryGB fields. That leaves these discrepancies:
If someone could confirm that MemoryGB and EphemeralDisks sizes aren't actually used, then I think this is about ready to merge. We could consider removing the fields (replacing EphemeralDisks with a single count integer rather than a slice of sizes) as well. |
Code crossreference shows the fields as being unreferenced, except that hack/machine_types uses MemoryGB to sort the instance types. Unless something is referenced through reflection. I was thinking of suggesting the rounding. |
/lgtm |
Yes, I'm reasonably sure we aren't using Memory or EphemeralDisk sizes 👍 This is great - thank you! |
ec2.DescribeInstanceTypes
provides us with all of the information needed to build the machine types list. I consider this an intermediate PR: we can switch to this in the hack script and validate its output, then later switch to using the call inupup/pkg/fi/cloudup/awsup/machine_types.go
directly, removing the hardcoded list altogether which would decouple instance type support from kops releases.Marking WIP until I get a chance to review the differences in
upup/pkg/fi/cloudup/awsup/machine_types.go
since ideally there would be none.In the case of the missing instance types (
cr1.8xlarge
,hs1.8xlarge
,m6g.*
), I'm guessing the AWS account I ran this on doesn't have those instance types available: thecr1
andhs1
might have been deprecated before my account was created and I know my account hasnt opted in to them6g
preview yet. We can figure out a short term workaround for those given that once the followup PR would land, the account runningec2.DescribeInstanceTypes
will always be the same account the instance lives in, so I'd be confident that the instance type in use will be in the API response.I still need to review the Memory, Disk, and ENI differences and determine which values are correct.