-
Notifications
You must be signed in to change notification settings - Fork 1.2k
HPA v2beta2 #12278
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
HPA v2beta2 #12278
Conversation
Hi @enoodle. Thanks for your PR. I'm waiting for a knative 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/test-infra repository. |
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.
Let's do a liiiiittle more splitting. My goal would be to have no behavioral change in this first PR and focus just on the API changes.
if annotations[ClassAnnotationKey] == HPA && (annotations[MetricAnnotationKey] == CPU || annotations[MetricAnnotationKey] == Memory) { | ||
return apis.ErrInvalidKeyName(WindowAnnotationKey, apis.CurrentField, fmt.Sprintf("%s for %s %s", HPA, | ||
MetricAnnotationKey, annotations[MetricAnnotationKey])) | ||
} |
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.
Let's drop this for a subsequent PR.
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.
👍
}, { | ||
name: "value too short and invalid class for /window annotation", | ||
annotations: map[string]string{WindowAnnotationKey: "1s", ClassAnnotationKey: HPA, MetricAnnotationKey: CPU}, | ||
expectErr: fmt.Sprintf("invalid key name %q: \n%s for %s %s", WindowAnnotationKey, HPA, MetricAnnotationKey, CPU), |
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.
Split into the other PR please.
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.
👍
if window, hasWindow := pa.Window(); hasWindow { | ||
windowSeconds := int32(window.Seconds()) | ||
hpa.Spec.Behavior = &autoscalingv2beta2.HorizontalPodAutoscalerBehavior{ | ||
ScaleDown: &autoscalingv2beta2.HPAScalingRules{ | ||
StabilizationWindowSeconds: &windowSeconds, | ||
}, | ||
ScaleUp: &autoscalingv2beta2.HPAScalingRules{ | ||
StabilizationWindowSeconds: &windowSeconds, | ||
}, | ||
} | ||
} |
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 other PR please :)
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.
👍
Resource: &autoscalingv2beta2.ResourceMetricSource{ | ||
Name: corev1.ResourceMemory, | ||
Target: autoscalingv2beta2.MetricTarget{ | ||
Type: "AverageValue", |
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.
Is there a constant for AverageValue
and Utilization
maybe?
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.
👍
/ok-to-test |
Codecov Report
@@ Coverage Diff @@
## main #12278 +/- ##
==========================================
+ Coverage 87.25% 87.31% +0.05%
==========================================
Files 195 195
Lines 9605 9610 +5
==========================================
+ Hits 8381 8391 +10
+ Misses 941 939 -2
+ Partials 283 280 -3
Continue to review full report at Codecov.
|
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.
Does the e2e test also need to be updated to v2beta2?
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 only thing I see missing is the e2e test Paul mentioned, otherwise the PR changes the version without any behavioural changes and tests are passing, so looking good
Resource: &autoscalingv2beta2.ResourceMetricSource{ | ||
Name: corev1.ResourceCPU, | ||
Target: autoscalingv2beta2.MetricTarget{ | ||
Type: "Utilization", |
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.
Should use the same constant as above (throughout this file)
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.
👍
lgtm |
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 checked the availability of the API and v2beta1 seems to have been deprecated in 1.19, so this is timely!
Thanks!
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: enoodle, markusthoemmes 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 |
Update the HPA autoscaling version to v2beta2 to allow setting window and in the future also scale rate
Proposed Changes
max-scale-up-rate
/max-scale-down-rate
./window
annotation for the HPA autoscaler.Release Note