- Labels are simple key value pairs that you can assign to resources
"environment" : "dev", "environment" : "qa", "environment" : "production"
"tier" : "frontend", "tier" : "backend", "tier" : "cache"
"partition" : "customerA", "partition" : "customerB"
-
Labels classify things
-
Selectors allow you to use the labels to filter things
- Based on equality
environment = production tier != frontend
- Set based
environment in (production, qa) tier notin (frontend, backend) partition !partition
-
Attach a label to a node
-
Define a
nodeSelector
for the pod!
Three "levels" of affinities!
-
Preferred during scheduling ignored during execution
-
Required while scheduling and but ignore during execution
-
Required for scheduling and also during execution
- A pod can be defined to have affinity for certain nodes
- Schedule pods together
- These pods hate each other