Forum breadcrumbs - You are here:Tracston Community Forum - DevOps, Micro Services, Cloud, Infrastructure, Development, Monitoring and more...DevOps / Micro Services / Automation: Kubernetes & Helm ChartsAttach Pod to a specific node
You need to log in to create posts and topics.
Attach Pod to a specific node
Moshe Sharon@admin
#1 · 17/07/2023, 9:12 am
Quote from Moshe Sharon on 17/07/2023, 9:12 amProblem
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: nodenameoperator: Invalues:- node2
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: nodenameoperator: Invalues:- node2
Click for thumbs down.0Click for thumbs up.0