KCNA ยท Kubernetes core concepts
Labels, selectors, annotations and namespaces
Organizing and selecting objects, namespace scoping, resource quotas at a conceptual level.
Key points
- Labels are key/value pairs for identifying objects; selectors pick objects by label (how a Service finds Pods or a ReplicaSet finds its own).
- Annotations hold non-identifying metadata and are not used for selection.
- Namespaces split a cluster into scopes: names are unique within one, and ResourceQuotas cap what a namespace can consume.
Source: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
Practice questions
Which metadata is meant for identifying and selecting objects?
- Annotations
- Labels
- Finalizers
- Status
Show answer
Answer: B. Labels
Labels are the selectable identifying key/value pairs. Annotations carry extra non-identifying information.
Which statements about namespaces are correct?
- Resource names must be unique within a namespace
- ResourceQuotas can limit consumption per namespace
- Nodes are not namespaced objects
- Namespaces can be nested inside each other
- Every cluster-wide object lives in default
Show answer
Answer: A. Resource names must be unique within a namespace, B. ResourceQuotas can limit consumption per namespace, C. Nodes are not namespaced objects
Names are scoped per namespace, quotas apply per namespace and cluster-level objects like Nodes belong to none. Nesting is not supported.
Namespaces can be nested inside each other to build a hierarchy.
Show answer
Answer: False
Namespaces are flat; each namespaced object belongs to exactly one namespace.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
