i want to do something like
nodeSelector:
role: "!database"
in order to schedule pods on nodes which don't host the database.
Thank you
Labels can be used to organize and to select subsets of objects. Via a label selector, the client/user can identify a set of objects. The label selector is the core grouping primitive in Kubernetes. In a nutshell label selectors depend on labels to select a group of resources such as pods.
A node selector specifies a map of key/value pairs that are defined using custom labels on nodes and selectors specified in pods. For the pod to be eligible to run on a node, the pod must have the same key/value node selector as the label on the node.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With