<p>I know we can do the following commands:</p>

<ul>
<li><code>kubectl get pods -l app==&lt;kafka&gt;</code> gets pods with kafka label </li>
<li><code>kubectl get pods -l app!=&lt;kafka&gt;</code> gets pods without kafka label </li>
<li><code>kubectl get pods -l app=kafka,env=staging</code> gets pods with both kafka and staging labels</li>
</ul>

<p>But what about if I want to list all the pods which have either <code>kafka</code> or <code>zookeeper</code> label. Something like <code>-l app==kafka||zookeeper</code>.</p>

<p>Is this even possible with <code>-l</code> kubectl option...?</p>

<p>Have you tried this? </p>

<pre><code>kubectl get pods -l 'app in (kafka, zookeeper)'
</code></pre>

<p>See: <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api</a></p>
