What labels and annotations should every workload carry, and why?
BeginnerScenarioUpgrades, etcd, disaster recovery and incidents
Answer
Situation read → The platform team wants consistent metadata for cost and ownership.
What I'd do →
- Use recommended labels such as
app.kubernetes.io/name,app.kubernetes.io/instance,app.kubernetes.io/version - Add
team,envandcost-centerlabels - Use annotations for non-identifying metadata such as runbook links
- Enforce with Kyverno or ValidatingAdmissionPolicy
- Query with
kubectl get pods -l team=payments
Why → Labels drive selectors, cost allocation and policy, so they must be consistent.
Interview tip → Remember labels select, annotations describe.
More on Upgrades, etcd, disaster recovery and incidents
How do you back up etcd on a self-managed cluster?BeginnerHow do you restore a cluster from an etcd snapshot?Advancedetcd database space exceeded: `mvcc: database space exceeded`. What now?AdvancedWalk through a kubeadm minor version upgrade.AdvancedHow do you find deprecated or removed APIs before an upgrade?IntermediateA cluster upgrade broke an operator because its CRD API version was removed. How do you recover?Advanced