-
Notifications
You must be signed in to change notification settings - Fork 636
✨ feat: Implement autoscaling from zero by auto-populating AWSMachineTemplate capacity #5711
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
base: main
Are you sure you want to change the base?
✨ feat: Implement autoscaling from zero by auto-populating AWSMachineTemplate capacity #5711
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Hi @LiangquanLi930. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
f1ee365 to
3be8f4d
Compare
01be987 to
915f55b
Compare
915f55b to
b3850d1
Compare
b0eae44 to
6ab7428
Compare
6df5996 to
5b5a139
Compare
af3844f to
8371031
Compare
56615b5 to
3bf0acb
Compare
|
/test pull-cluster-api-provider-aws-e2e |
|
@LiangquanLi930: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
ca67a57 to
2090092
Compare
|
@elmiko @nrb @chrischdi Thanks for your review! When you have time, could you help to review again? Thanks! |
| if info.MemoryInfo != nil && info.MemoryInfo.SizeInMiB != nil { | ||
| memoryBytes := *info.MemoryInfo.SizeInMiB * 1024 * 1024 | ||
| resourceList[corev1.ResourceMemory] = *resource.NewQuantity(memoryBytes, resource.BinarySI) | ||
| } |
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.
I'm not sure whether my handling of this part is correct, and I’m also uncertain about which unit I should be using.
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 machine-api annotations used a calculation of MiB for its value. for the cluster-api implementation we should simply be using a Quantity for this value, no need to convert to MiB.
you can see an example in the cluster-api autoscaler docs.
i /think/ the logic you have here is correct though, but i don't think we need to do the conversion. unless we need it for the Quantity.
| // Skip if capacity and nodeInfo are already set | ||
| if len(awsMachineTemplate.Status.Capacity) > 0 && awsMachineTemplate.Status.NodeInfo != nil { | ||
| return ctrl.Result{}, nil | ||
| } | ||
|
|
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.
| // Skip if capacity and nodeInfo are already set | |
| if len(awsMachineTemplate.Status.Capacity) > 0 && awsMachineTemplate.Status.NodeInfo != nil { | |
| return ctrl.Result{}, nil | |
| } |
Either drop the skip, or do not skip if template.Spec.Template.Spec.AMI.ID is empty.
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.
updated
2090092 to
b0477c1
Compare
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.
i think this is looking good, although i'm not sure we need to do the conversion for the memory value.
| if info.MemoryInfo != nil && info.MemoryInfo.SizeInMiB != nil { | ||
| memoryBytes := *info.MemoryInfo.SizeInMiB * 1024 * 1024 | ||
| resourceList[corev1.ResourceMemory] = *resource.NewQuantity(memoryBytes, resource.BinarySI) | ||
| } |
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 machine-api annotations used a calculation of MiB for its value. for the cluster-api implementation we should simply be using a Quantity for this value, no need to convert to MiB.
you can see an example in the cluster-api autoscaler docs.
i /think/ the logic you have here is correct though, but i don't think we need to do the conversion. unless we need it for the Quantity.
✨ Implement autoscaling from zero by auto-populating AWSMachineTemplate capacity and NodeInfo
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR implements the Cluster API autoscaling from zero proposal for CAPA by adding a controller that automatically populates
AWSMachineTemplate.Status.Capacitywith instance type information.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Checklist:
Release note: