<p>I want to scale in a pod with a specific label, but it seems -l does not work for scaling.</p>

<p>For example, if I have pods bla-12345-aaaaa, bla-12345-bbbbb, and bla-12345-cccc, and I scale in to 2 replicas, I want bla-12345-aaaaa specifically to disappear.</p>

<p>I get this error:</p>

<pre><code>kubectl scale --replicas=2 deployment/bla -l scaleIn=true
error: selectors and the all flag cannot be used when passing resource/name arguments
</code></pre>

<p>You can see it in the documentation: </p>

<blockquote>
  <p>-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)</p>
</blockquote>

surimi sticks
<p>Follow the below command</p>

<pre><code>kubectl scale  deployment/bla --replicas=2
</code></pre>

<p>Note: You cant scale pods. you can scale replicaSets/Deployments/StatefulSets</p>

<p>Follow the below steps to scale deployment by label</p>

<pre><code>[root@f482a0035623 work]# kubectl get deploy -l app=web   
NAME     READY   UP-TO-DATE   AVAILABLE   AGE
webapp   1/1     1            1           88d
[root@f482a0035623 work]# kubectl scale deploy -l app=web --replicas=2
deployment.extensions/webapp scaled
[root@f482a0035623 work]# kubectl get deploy -l app=web
NAME     READY   UP-TO-DATE   AVAILABLE   AGE
webapp   2/2     2            2           88d
</code></pre>
