<p>i want to do something like</p>

<pre><code>nodeSelector:
  role: "!database"
</code></pre>

<p>in order to schedule pods on nodes which don't host the database.</p>

<p>Thank you</p>

<p>from here:
<a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/" rel="noreferrer">https://kubernetes.io/docs/concepts/configuration/assign-pod-node/</a></p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: with-node-affinity
spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: role
            operator: NotIn
            values:
            - database
</code></pre>
