karpenter-provider-aws
karpenter-provider-aws copied to clipboard
feat: Discover Instance Type Memory Capacity
Fixes #5161
Description
This adds a new controller for managing a cache on the instancetype provider that stores the memory capacity overhead for each instance type by comparing the actual value after a Kubernetes Node gets registered with the cluster.
The cache is then implemented by NewInstanceType() when calculating memory capacity. If a cached value doesn't exist it will fall back to the existing logic of vmMemoryOverheadPercent
.
The cache is keyed by a combination of instance type name and hash of nodeClass.Status.AMIs so this should always be accurate and when an AMI update is triggered will use the existing logic of calculating against vmMemoryOverheadPercent
to ensure safe instance creation every time.
How was this change tested? Suite tests and live environment
Does this change impact docs?
- [ ] Yes, PR includes docs updates
- [X] Yes, issue opened:
- [ ] No
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.