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
Check whether metricObj can be converted to *v1beta2.MetricValueList #80392
Conversation
cc @piosz |
@kawych Could we get this reviewed? |
/cc @MaciekPytel @DirectXMan12 @losipiuk Could one of you take a look at this? This seems to be a serious bug with HPA panic'ing and causing controller-manager to crashloop when the typecast to v1beta2 doesn't work:
This seems to be a regression introduced in this commit - kubernetes/metrics@2bd4d84 Happy to give more info. |
I digged a bit further into the issue and found the following:
|
I think a while ago we had this issue, too. |
staging/src/k8s.io/metrics/pkg/client/custom_metrics/versioned_client.go
Outdated
Show resolved
Hide resolved
We have an open PR that should fix the issue on our side for users of v1beta1 (GKE) zalando-incubator/kube-metrics-adapter#64 |
ping @piosz for review |
@kawych |
/lgtm |
Fixes the response from `GetMetricsBySelector` in case no metrics are found. This issue caused a panic in kube-controller-manager: kubernetes/kubernetes#80392 Fix #40 Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
Fixes the response from `GetMetricsBySelector` in case no metrics are found. This issue caused a panic in kube-controller-manager: kubernetes/kubernetes#80392 Fix #40 Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
Fixes the response from `GetMetricsBySelector` in case no metrics are found. This issue caused a panic in kube-controller-manager: kubernetes/kubernetes#80392 Fix #40 Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
@piosz |
/approve |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: piosz, tedyu 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 |
Thanks! @tedyu Could you cherry-pick the changes to our supported versions (1.13, 1.14, 1.15)? |
I would be happy to do that. My workspace is with master. Thanks |
You can use this script to generate PRs for the patches - https://github.com/kubernetes/kubernetes/blob/master/hack/cherry_pick_pull.sh |
What type of PR is this?
/kind bug
What this PR does / why we need it:
As #80390 mentioned, namespacedMetrics#GetForObject doesn't check whether metricObj can be converted to *v1beta2.MetricValueList .
this PR adds the check to avoid potential panic.
Which issue(s) this PR fixes:
Fixes #80390
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: