How to achieve set based node selection (using nodeSelector) in kubernetes

6/20/2016

I have 1 master and 5 nodes cluster.I want to run three nginx pods in two specific nodes.Using nodeSelector i can achieve it but the problem is that all nodes are labled as same key name but different values.

-- Prakash
kubernetes
kubernetes-pod
nodes
selector

1 Answer

6/23/2016

Have you checked alpha feature "Node Affinity"? That allows you matching labels in a set. Just search "Alpha feature in Kubernetes v1.2: Node Affinity" in doc http://kubernetes.io/docs/user-guide/node-selection/. It has an example exactly matching your use case.

-- caesarxuchao
Source: StackOverflow