I'm trying to deploy pods on the nodes which have labels like es-node: data-1, es-node:data-2, es-node:data-3. I can use all the labels in pod's nodeaffinity spec but i just want to use single label entry as es-node:data-* so that it gets deployed on all the nodes. Is this even possible?
Newer resources, such as Job
, Deployment
, ReplicaSet
, and DaemonSet
, support set-based requirements. I haven't tested this but you could probably use something like:
selector:
matchExpressions:
- {key: es-node, operator: In, values: [data-1, data-2, data-3]}
Openshift examples on using matchExpressions
:
I don't think you can specify regular expressions on label selectors but you can just add an additional label, let's say es-node-type: data
and put that as a label selector for your deployment or stateful set.