Skip to content
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

CPVPA fails if some API is not discoverable #35

Closed
rfranzke opened this issue Apr 20, 2020 · 4 comments · Fixed by #36
Closed

CPVPA fails if some API is not discoverable #35

rfranzke opened this issue Apr 20, 2020 · 4 comments · Fixed by #36
Assignees

Comments

@rfranzke
Copy link
Contributor

If there are APIServices that are not discoverable then the CPVPA is crashlooping:

$ kubectl get apiservice  | grep metrics-ad
v1beta1.custom.metrics.k8s.io          kube-system/kube-metrics-adapter   False (MissingEndpoints)   26d
v1beta1.external.metrics.k8s.io        kube-system/kube-metrics-adapter   False (MissingEndpoints)   26d

$ kubectl -n kube-system logs calico-typha-vertical-autoscaler-5557c6d7d-2sd7c
I0420 04:39:57.408180       1 autoscaler.go:46] Scaling namespace: kube-system, target: deployment/calico-typha-deploy
E0420 04:39:59.408093       1 autoscaler.go:49] failed to discover apigroup for kind "Deployment": unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request, external.metrics.k8s.io/v1beta1: the server is currently unable to handle the request

Is this desired behaviour? If yes, why does the CPVPA need to discover the full API?

@MrHohn
Copy link
Member

MrHohn commented Apr 21, 2020

Thanks for reporting, I wasn't aware that our usage on the discovery API would be buggy like this. I will take a look when I get a chance.

@rfranzke
Copy link
Contributor Author

@MrHohn any chance to fix this soon? I could also help if you point me to the right code location that needs adjustments.

@MrHohn
Copy link
Member

MrHohn commented May 26, 2020

@rfranzke Sorry for lacking update here, I haven't got a chance to take a closer look on this, so could definitely use your help if you are available :)

The exact code location is:

resourceLists, err := client.Discovery().ServerPreferredNamespacedResources()
if err != nil {
return "", nil, fmt.Errorf("failed to discover apigroup for kind %q: %v", kind, err)
}

Is this desired behaviour? If yes, why does the CPVPA need to discover the full API?

I don't think CPVPA needs to discover the full API, just the relevant ones would be sufficient.

@rfranzke
Copy link
Contributor Author

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants