I am trying to run a pod where the default limit of my GKE AutoPilot Cluster is 500m vCPU.. But I want to run all my pods by 250m vCPU only. I tried the command kubectl run pod-0 --requests="cpu=150m" --restart=Never --image=example/only
But I get a warning: Flag --requests has been deprecated, has no effect and will be removed in the future. Then when I describe my pod, it sets 500m. I would like to know option to set resource limits with just plainly kubectl run pod
Since kubectl v1.21 All generators are deprecated.
Github issue: Remove generators from kubectl commands quote:
kubectl command are going to get rid of the dependency on the generators, and ultimately remove them entirely. The main goal is to simplify the use of kubectl command. This is already done in kubectl run, see #87077 and #68132.
So it looks like --limits and --requests flags willn't longer be available in the future.
Here is the PR that did it: Drop deprecated run flags and deprecate unused ones.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With