Label and Annotation¶
https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
Labels can be used to
select objectsand tofind collections of objectsthat satisfy certain conditions.Annotations are not used to identify and select objects - to
attach arbitrary non-identifying metadata to objects.
get node labels¶
kubectl get nodes --show-labels | sed 's/,/\n /g' #works
kubectl get nodes --show-labels | tr , '\n ' #can't add space
Well-Known Labels, Annotations and Taints¶
https://kubernetes.io/docs/reference/labels-annotations-taints/