<p>I have a kubernetes deployments under the test-namespace as given below</p>
<pre><code>NAME                      READY   UP-TO-DATE   AVAILABLE   AGE
test-controller           1/1     1            1           38d
services-controller       1/1     1            1           38d
intimidation-controller   1/1     1            1           38d
Origin-controller         2/2     2            2          38d
</code></pre>
<p>What command I can use to list only deployments which are having replica count less than 2.
So that if I run that command it should return only below output</p>
<pre><code>test-controller          
services-controller       
intimidation-controller
</code></pre>
<p>I used following command for this , but it didn't help and didn't retun anything</p>
<pre><code> kubectl get deployment   -n test-namespace -o=jsonpath='{.status.Readyreplicas=1}'
</code></pre>
<p>What Command I could use to fetch only the deployment names with less than two replica count</p>

mystack
<p>something like this ?</p>
<pre><code>kubectl get deployments.apps -o jsonpath=&quot;{range .items[*]}{.metadata.name}{\&quot;\t\&quot;}{.status.replicas}{\&quot;\n\&quot;}{end}&quot; | awk '/1/ {print$1,&quot; &quot;,$NF}'
</code></pre>
