Forum Navigation
You need to log in to create posts and topics.

Attach Pod to a specific node

Problem

Pods distributed in the cluster not evenly and user wants to deploy pods / deployments on a specific node

Solution 

kubectl get nodes --show-labels

kubectl label nodes <MYNODE> nodename=node2

Add Pod Affinity for you deployment

affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: nodename
operator: In
values:
- node2