Skip to content

Commit

Permalink
Update instance types documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis committed Aug 30, 2023
1 parent 665d198 commit e861f7b
Show file tree
Hide file tree
Showing 4 changed files with 1,352 additions and 1,396 deletions.
6 changes: 3 additions & 3 deletions pkg/providers/instancetype/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func NewInstanceType(ctx context.Context, info *ec2.InstanceTypeInfo, kc *v1alph
Overhead: &cloudprovider.InstanceTypeOverhead{
KubeReserved: kubeReservedResources(cpu(info), pods(ctx, info, amiFamily, kc), ENILimitedPods(ctx, info), amiFamily, kc),
SystemReserved: systemReservedResources(kc),
EvictionThreshold: evictionThreshold(memory(ctx, info), ephemeralStorage(amiFamily, nodeTemplate.Spec.BlockDeviceMappings), amiFamily, kc),
EvictionThreshold: evictionThreshold(memory(info), ephemeralStorage(amiFamily, nodeTemplate.Spec.BlockDeviceMappings), amiFamily, kc),
},
}
}
Expand Down Expand Up @@ -173,7 +173,7 @@ func computeCapacity(ctx context.Context, info *ec2.InstanceTypeInfo, amiFamily

resourceList := v1.ResourceList{
v1.ResourceCPU: *cpu(info),
v1.ResourceMemory: *memory(ctx, info),
v1.ResourceMemory: *memory(info),
v1.ResourceEphemeralStorage: *ephemeralStorage(amiFamily, blockDeviceMappings),
v1.ResourcePods: *pods(ctx, info, amiFamily, kc),
v1alpha1.ResourceAWSPodENI: *awsPodENI(ctx, aws.StringValue(info.InstanceType)),
Expand All @@ -193,7 +193,7 @@ func cpu(info *ec2.InstanceTypeInfo) *resource.Quantity {
return resources.Quantity(fmt.Sprint(*info.VCpuInfo.DefaultVCpus))
}

func memory(ctx context.Context, info *ec2.InstanceTypeInfo) *resource.Quantity {
func memory(info *ec2.InstanceTypeInfo) *resource.Quantity {
sizeInMib := *info.MemoryInfo.SizeInMiB
// Gravitons have an extra 64 MiB of cma reserved memory that we can't use
if len(info.ProcessorInfo.SupportedArchitectures) > 0 && *info.ProcessorInfo.SupportedArchitectures[0] == "arm64" {
Expand Down
Loading

0 comments on commit e861f7b

Please sign in to comment.