EKS Node selector - possible labels
A customer using EKS on AWS would like to isolate worker nodes on different racks. I can define
labels manually as per: https://www.eksworkshop.com/beginner/140_assigning_pods/node_selector/ but I was wondering if automatic labels are perhaps available when K8s detects AWS rack-level placement groups.
My question ultimately is: are
labels always user-defined or are there automated labels ? Is there any other strategy to create anti-affinity rules (e.g per-AZ nodes) ?
EKS is automatically adding labels to your nodes as you can see below. This information can be used for your node selectors and anti-affinity rules. That said, Placement Groups aren't automatically included as label on the node. You should define custom labels for identifying the nodes in you placement group and expose the topology for the node selectors. There is a blog post which shows you how to do this as well.
kubectl describe node ip-***-***-***-***.eu-west-1.compute.internal Name: ip-***-***-***-***.eu-west-1.compute.internal Roles: <none> Labels: alpha.eksctl.io/cluster-name=eksworkshop-eksctl alpha.eksctl.io/nodegroup-name=nodegroup beta.kubernetes.io/arch=amd64 beta.kubernetes.io/instance-type=t3.small beta.kubernetes.io/os=linux eks.amazonaws.com/capacityType=ON_DEMAND eks.amazonaws.com/nodegroup=nodegroup eks.amazonaws.com/nodegroup-image=ami-05fbcac3cb8054b00 eks.amazonaws.com/sourceLaunchTemplateId=lt-08bc0e2abce65746a eks.amazonaws.com/sourceLaunchTemplateVersion=1 failure-domain.beta.kubernetes.io/region=eu-west-1 failure-domain.beta.kubernetes.io/zone=eu-west-1b kubernetes.io/arch=amd64 kubernetes.io/hostname=ip-***-***-***-***.eu-west-1.compute.internal kubernetes.io/os=linux node.kubernetes.io/instance-type=t3.small topology.kubernetes.io/region=eu-west-1 topology.kubernetes.io/zone=eu-west-1b
Thanks Vincent, exactly the information I needed, plus I hadn't spotted this blog post!
EKS Worker-node joinasked 3 years ago
EKS pods get node IP address instead of IP from Calico IP PoolAccepted Answerasked 2 months ago
EKS Node selector - possible labelsAccepted AnswerEXPERTasked 6 months ago
EKS: ARM64 nodes fail to become ready due to CNI errorasked 5 months ago
How does EMR on EKS deployment model support EMR auto-scaling/managed scaling?Accepted Answerasked a year ago
Query EKS node information with Python Boto3 or AWS CLIAccepted Answerasked a month ago
EKS static IPs for managed node group nodesAccepted Answerasked a year ago
How can I achieve multiple-object detection with Amazon Rekognition Custom Labels?Accepted Answerasked a year ago
Implications of automatic EKS Platform version updateasked 2 months ago
Update EKS 1.16 managed worker nodes with 1.16 AMI do not join the clusterasked 2 years ago