Common metadata block for selectors and tooling.
Section: Metadata, Labels, and Annotations
Labels and annotations example
yaml
yaml
metadata:
name: api
namespace: prod
labels:
app.kubernetes.io/name: api
app.kubernetes.io/component: backend
app.kubernetes.io/part-of: storefront
tier: web
annotations:
kubectl.kubernetes.io/default-container: api
reloader.stakater.com/auto: "true"Explanation
Labels are queryable and support selectors; annotations hold arbitrary metadata that tools and operators consume.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Metadata, Labels, and Annotations