-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Using VPA with custom controllers #3060
Comments
In addition to supporting most common controllers, VPA can target custom resources without changes to code. However, your custom resource needs to support scale subresource so that VPA can find out which pods it controlls: Let me know if this works for you. |
I'm trying this in GKE: bash-4.2$ ./vpa-up.sh bash-4.2$ kubectl describe vpa Message: Cannot read targetRef. Reason: Unhandled targetRef <api_group>/ / <custom resource> / <name>, last error resource.api.group "<name>" is forbidden: User "system:serviceaccount:kube-system:vpa-recommender" cannot get resource "<resource>/scale" in API group "<api group>" in the namespace "<custom namespace>" In my CRD, I have added: kubectl get --raw /apis// | jq { Any thoughts as to why VPA is complaining about the resource not being there? |
Might be permission issues. Can you try modifying vpa-rbac.yaml to enable VPA recommender to get and watch your custom resource? |
There is a PR in review that might fix this. |
#3139 should fix this. Please reopen if you still see issues |
/close |
@bskiba: Closing this issue. In response to this:
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. |
facing this error |
same error as above |
In my project, I have a Kubernetes custom resource with a custom controller. I was trying to use VPA with the custom controller. I'm basically following this: 8ff3b4f to add my custom resource. I need a separate clientset for my custom resource. I couldn't find any good way to hook that code into existing VPA code. Do you have any recommendation on how to go about adding a custom resource to VPA?
The text was updated successfully, but these errors were encountered: