EKS - Node labels
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
Node labels in Amazon EKS are ordinary Kubernetes node labels used to describe nodes and steer scheduling. They are useful for targeting workloads to specific node groups, hardware types, availability zones, or operational roles, but they only help when your pods explicitly select or prefer those labels.
What Node Labels Are
A node label is a key-value pair attached to a Kubernetes node.
Examples:
- '
workload=batch' - '
team=ml' - '
node.kubernetes.io/instance-type=m5.large'
You can inspect them with:
EKS nodes also come with useful built-in labels from Kubernetes and AWS integration, such as region, zone, architecture, and instance type information.
Add A Label To An Existing Node
For a quick manual change:
That updates the node object immediately.
To overwrite an existing value:
This is useful for experiments and debugging, but for long-term cluster management you usually want labels applied by node group configuration or bootstrap automation rather than by ad hoc manual commands.
Use Labels In Scheduling
Node labels matter only when a workload refers to them.
The simplest form is nodeSelector:
Now the pods will only schedule onto nodes labeled workload=batch.
For more flexible rules, use node affinity.
Prefer Node Affinity For Richer Logic
Node affinity lets you express preferred or required rules.
This is better than nodeSelector when:
- multiple values are acceptable
- the matching logic is more complex
- you want soft preferences rather than hard requirements
That is often how production EKS clusters evolve as scheduling rules get more nuanced.
EKS Node Groups And Labels
In EKS, it is common to align labels with node groups. For example:
- one node group for general workloads
- one node group for GPU jobs
- one node group for internal services
Then each group gets labels that describe its purpose.
That allows workloads to target a group by scheduling policy instead of hardcoding node names, which would be brittle and operationally expensive.
Whether you use managed node groups, self-managed nodes, or Karpenter-style provisioning, the principle stays the same: labels describe capability or role, and scheduling policies consume those labels.
Labels Versus Taints
A very common confusion is mixing up labels and taints.
- labels help pods select nodes
- taints repel pods unless tolerations are added
If the goal is simply "schedule these pods onto these nodes," labels plus selectors or affinity are usually enough.
If the goal is also "keep other pods away," taints and tolerations may be the better tool.
In EKS, the two are often used together for special-purpose node groups.
Keep Labels Stable And Meaningful
Good labels describe durable characteristics:
- workload role
- hardware type
- environment purpose
- region or zone identity when needed
Poor labels describe temporary operational trivia that changes frequently.
The more stable your labeling strategy is, the easier it is to build reliable scheduling rules around it.
Common Pitfalls
The biggest mistake is adding labels and expecting them to change scheduling automatically. Pods only use labels if their manifests include selectors or affinity rules.
Another mistake is labeling individual nodes manually in a managed environment and then forgetting that replacements or scaling events may create new nodes without the same ad hoc label unless the node group config also applies it.
People also overuse labels when they really need taints to protect special-purpose nodes from general workloads.
Finally, do not build scheduling around node names. In EKS, nodes come and go; labels should represent stable intent, not a particular machine identity.
Summary
- Node labels in EKS are standard Kubernetes labels attached to nodes.
- Use
kubectl get nodes --show-labelsto inspect them andkubectl label nodeto add or change them. - Labels influence scheduling only when pods use
nodeSelectoror node affinity. - Align labels with node group roles for long-term maintainability.
- Use taints and tolerations as a separate tool when you need to repel unrelated workloads.
Related reading
- EKS Ingress with Single ALB, multiple namespaces, and External DNS
- EKS Kubernetes outbound traffic
- eksctl create cluster stuck waiting for CloudFormation stack
- Elastic Search Adding nodes to cluster on the fly
- EKS ALB is not to able to auto-discover subnets
- EKS Error syncing load balancer failed to ensure load balancer Multiple tagged security groups found for instance
- Elasticsearch 7.2.0 master not discovered or elected yet, an election requires at least X nodes
- Elasticsearch fails to start on AWS kubernetes cluster

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.