<p>I need to retrieve a list of pods by selecting their corresponding labels.
When the pods have a simple label <code>app=foo</code>, <code>k8s-app=bar</code>, the selection is quite easy:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl get po -l 'app in (foo), k8s-app in (bar)'
</code></pre>
<p>The complexity comes with labels that contain special characters, for example: <code>app.kubernetes.io/name=foo</code>
So when I query only this label, I don't have a problem, but if I try to add this label to the existing query, it will end by returning <code>no resources were found</code>.</p>
<pre class="lang-sh prettyprint-override"><code>kubectl get po -l app.kubernetes.io/name=foo,app=bar
kubectl get po -l 'app.kubernetes.io/name in (foo), app in (bar)'
</code></pre>
<p>Any idea how can I join the two labels in a single query?</p>

<p>Currently, Kubernetes does not support OR in label selectors. You can only OR different values of the same label (like <code>kubectl get pods -l 'app in (foo,bar)'</code>).</p>
<p>See also <a href="https://stackoverflow.com/questions/46028731/how-can-the-or-selector-be-used-with-labels-in-kubernetes">How can the OR selector be used with labels in Kubernetes?</a></p>
