-
Notifications
You must be signed in to change notification settings - Fork 952
Add --subresource flag to kubectl set resources #1728
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
Comments
This issue is currently awaiting triage. SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the The 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-sigs/prow repository. |
We will accept this issue, right now we are discussing whether we should deprecate the command for pods and point people to apply or patch, or try and fix it. We will bring it up on the next sig-cli meeting. |
Awesome! Thanks for considering this. I wanted to elaborate a little...
If we decide to deprecate this:
And yes, a pod itself does not define a template of a pod. But I still believe this can be made more clear. I type this command somewhat often when testing and experimenting on stuff and would love for it to exist in a post-1.32 world. In the meantime, I implemented something similar as a kubectl plugin: https://github.com/LarssonOliver/kubectl-set_pod_resources Thanks! |
This particular issue was discussed during yesterday's SIG-CLI call. To provide some context, --subresource flag was meant to help with working with multiple sub-resources as described in that enhancement. So it's already possible to combine it with Base on the above we've decide not to expand the currently existing flags to support this very narrow use-case. /remove-triage accepted |
@soltysh: 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-sigs/prow repository. |
What would you like to be added:
Hi! 👋
I'd like the
--subresources
flag to be available in thekubectl set resources
command.Why is this needed:
Since 1.32, updating resources of running pods is done using the
/resize
subresource (see kubernetes/kubernetes#128266).Pre-1.32, when using the
InPlacePodVerticalScaling
feature gate, resources of pods could be updated using thekubectl set resources
command. Since this is no longer the case, we now have to use the following patch command:kubectl patch pod nginx --subresource resize --patch '{"spec":{"containers":[{"name":"nginx","resources":{"requests":{"cpu":"2"},"limits":{"cpu":"4"}}}]}}'
If we add the
--subresource
flag to theset resources
command, we would once again be able to use it to update the resources of running pods. Example:kubectl set resources pod nginx --subresource resize --requests=cpu=2 --limits=cpu=4
An alternative solution could be that
set resources
automatically invokes the/resize
subresource should the target resource of type be "pod".The text was updated successfully, but these errors were encountered: