Gke - kubernetes / how to ensure deployment isolation on a given node

5/14/2019

A little bit lost in between nodeselector, affinity / anti affinity; taints

What i'd be interested in would be to ensure that a single pod/deployement would run on a given node, not anywhere else. and that this node would not receive any other pod than the specified one

Given the options above (if there are any else), what would be the most concise way to do so ?

-- Ben
google-kubernetes-engine
kubernetes
kubernetes-deployment
kubernetes-pod

1 Answer

5/14/2019

Add some label only on one node.
or
You can create a new node-pool with one node.(I would prefer this since this can work well with autoscaling, set min, max nodes to 1)

Create a deployment with one replica and affinity equal to this node.

To limit running just this pod on node:
1) You can add resource limit equal to node's resource value, so that no other pods are scheduled on this node.
or
2) Use some default affinity for all the other pods
or
3) Use node-isolation-restriction to restrict which pods can be scheduled on this node. Haven't tried this myself yet

-- Ankit Deshpande
Source: StackOverflow