i want to schedule 10 pods in two specific node(total 15 nodes in our kube cluster).
so in replication-controller file i am mentioning two values in nodeSelector like below.
nodeSelector:
app: node1
app: node2
problem is that all the time it's taking only node2.whatever sequence i am mentioning, it's taking last node only.
note: node1
and node2
are lables of node.
The better way is in using something like this:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- node1
- node2