<p>I am trying to run a pod where the default limit of my <strong>GKE AutoPilot Cluster is 500m vCPU</strong>.. But I want to run all my pods by 250m vCPU only. I tried the command <code>kubectl run pod-0 --requests=&quot;cpu=150m&quot; --restart=Never --image=example/only</code></p>
<p>But I get a warning: <code>Flag --requests has been deprecated, has no effect and will be removed in the future</code>. Then when I describe my pod, it sets <code>500m</code>. I would like to know option to set resource limits with just plainly <code>kubectl run pod</code></p>

<p>Since kubectl v1.21 All generators are depricated.</p>
<p>Github issue: <a href="https://github.com/kubernetes/kubernetes/issues/93100" rel="nofollow noreferrer">Remove generators from kubectl commands</a> quote:</p>
<blockquote>
<p>kubectl command are going to get rid of the dependency to the
generators, and ultimately remove them entirely. <strong>The main goal is to
simplyfy the use of kubectl command</strong>. This is already done in kubectl
run, see <a href="https://github.com/kubernetes/kubernetes/pull/87077" rel="nofollow noreferrer">#87077</a> and <a href="https://github.com/kubernetes/kubernetes/pull/68132" rel="nofollow noreferrer">#68132</a>.</p>
</blockquote>
<p>So it looks like <code>--limits</code> and <code>--requests</code> flags won't longer be available in the future.</p>
<p>Here is the PR that did it: <a href="https://github.com/kubernetes/kubernetes/pull/99732" rel="nofollow noreferrer">Drop deprecated run flags and deprecate unused ones</a>.</p>
