i want to do something like
nodeSelector:
role: "!database"
in order to schedule pods on nodes which don't host the database.
Thank you
Not right now.
Such a form was initially discussed in issue #341 and you can follow issue #15494 to track progress on a more configurable label selector.
from here: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
apiVersion: v1
kind: Pod
metadata:
name: with-node-affinity
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: role
operator: NotIn
values:
- database