HPA metrics specificity improvements#64097
HPA metrics specificity improvements#64097k8s-github-robot merged 8 commits intokubernetes:masterfrom
Conversation
fc43898 to
5054c35
Compare
4dd4d94 to
0b8d822
Compare
85ab679 to
dfc07b8
Compare
|
/ok-to-test |
b55aa0b to
0cf93da
Compare
|
For the APIServices int test, you need to enable the API version in PKG/master/master.go |
|
Make sure we have validation on the metric target |
|
you missed some cases of switching to |
|
conversions aren't quite right -- you don't properly populate the |
There was a problem hiding this comment.
why are these nil? If they're not needed, don't implement them
There was a problem hiding this comment.
That's what I thought, but without them defined as nil they get generated for some reason:
# k8s.io/kubernetes/pkg/apis/autoscaling/v2beta1
pkg/apis/autoscaling/v2beta1/zz_generated.conversion.go:507:12: undefined: Convert_v2beta1_CrossVersionObjectReference_To_autoscaling_MetricTarget
pkg/apis/autoscaling/v2beta1/zz_generated.conversion.go:519:12: undefined: Convert_autoscaling_MetricTarget_To_v2beta1_CrossVersionObjectReference
!!! [0530 21:24:29] Call tree:
!!! [0530 21:24:29] 1: /home/mdame/go/src/k8s.io/kubernetes/hack/lib/golang.sh:595 kube::golang::build_binaries_for_platform(...)
!!! [0530 21:24:29] 2: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
!!! [0530 21:24:29] Call tree:
!!! [0530 21:24:29] 1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
!!! [0530 21:24:29] Call tree:
!!! [0530 21:24:29] 1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
make: *** [Makefile:92: all] Error 1
(Output from just running make with those functions removed and zz_generated.conversion deleted)
I think it has to do with the fact that Target in v2beta1 is a CrossVersionObjectReference, but in v2beta2 we renamed that to DescribedObject and created a new field called Target that is a MetricTarget. So it's seeing Target=Target and trying to auto-convert CrossVersionObjectReference->MetricTarget and telling me I need to manually convert it (which I can't)
If I'm wrong, or there's a way around that, I can make the change (or I can add a comment explaining these functions, which I probably should have done first)
|
[MILESTONENOTIFIER] Milestone Pull Request: Up-to-date for process @DirectXMan12 @damemi @lavalamp Pull Request Labels
|
|
@smarterclayton did you have any more feedback you'd like to add to this? |
There was a problem hiding this comment.
These need to be sentences - newlines are not considered significant and will cause this to be run on output.
There was a problem hiding this comment.
You need to explain how this is different from CurrentAverageValue. Reading the godoc, I have no idea.
There was a problem hiding this comment.
This was actually added in error -- averageValue is sufficient for pods metrics. Thanks for catching, removed
There was a problem hiding this comment.
Is it ever valid to have no metrics? I think you need to add as a comment on the Metrics field in v2beta2 about the default. I.e "if not set, the default metric will be X% CPU utilization" (fill in the X)
There was a problem hiding this comment.
This is just following the defaults set by previous versions of the autoscaling API. Added a comment to the API about the default percentage (currently 80)
There was a problem hiding this comment.
Describe what happens if this is empty.
There was a problem hiding this comment.
Explain what selector means to the user in this context. Why would they set it, what happens if it is empty, etc.
There was a problem hiding this comment.
Done (also in other areas this appears-- v2beta1 and v2beta2)
There was a problem hiding this comment.
Explain what selector means to the user in this context. Why would they set it, what happens if it is empty, etc.
There was a problem hiding this comment.
Explain what selector means to the user in this context. Why would they set it, what happens if it is empty, etc.
There was a problem hiding this comment.
@smarterclayton updated with your feedback, is there anything else that stands out?
|
/retest |
1 similar comment
|
/retest |
|
/approve |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: damemi, DirectXMan12, smarterclayton The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Automatic merge from submit-queue (batch tested with PRs 67894, 64097). If you want to cherry-pick this change to another branch, please follow the instructions here. |
What this PR does / why we need it:
Improves available specificity for HPA metrics by adding metric selector fields for metrics of Pods and Objects.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Implements this KEP: kubernetes/community#2055
Special notes for your reviewer:
Need to add/update tests?
Release note:
/assign @DirectXMan12