<p>How can I write the following in namespaceSelector:                               </p>

<p>key=val OR key1=val1?</p>

<p>the following example is for AND, how can i write something for the OR option? </p>

<pre><code>matchExpressions:
            - {key: app, operator: In, values: [application]}
            - {key: app1, operator: In, values: [application1]}
</code></pre>

<p>i find option to do OR between values (see below in the image) but not between keys.                                                                         </p>

<pre><code>{key: app, operator: In, values: [application, app2, app3]}
</code></pre>

inza
<p>For the <code>matchExpressions</code> the definition is that all expressions must match (AND). In official <strong>Kubernetes</strong> <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements" rel="nofollow noreferrer">documentation</a> you can read:</p>

<blockquote>
  <p>All of the requirements, from both matchLabels and matchExpressions
  are ANDed together – they must all be satisfied in order to match.</p>
</blockquote>

<p>You could add multiple <code>from</code> terms to your network policy, for them only one needs to match (OR). More on <a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/#behavior-of-to-and-from-selectors" rel="nofollow noreferrer">behavior of to and from selectors</a>.</p>
