Kubernetes YAML Cheat Sheet
High-value Kubernetes YAML patterns for Pods, Deployments, Services, probes, resources, scheduling, and day-to-day manifest authoring.
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Manifest Basics
## Metadata, Labels, and Annotations
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"# Common metadata block for selectors and tooling.
## Pods and Containers
## Deployments
## Probes and Resources
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 10
periodSeconds: 10
readinessProbe:
httpGet:
path: /ready
port: http
initialDelaySeconds: 5
periodSeconds: 5
startupProbe:
httpGet:
path: /startup
port: http
failureThreshold: 30
periodSeconds: 10# Use health checks to control traffic and restarts.
## Scheduling and Placement
## YAML Validation and Troubleshooting
More in Kubernetes YAML
Kubernetes YAML Kustomize and CRDs
Kustomize overlays, patches, generators, and CRD/CR authoring patterns.
Kubernetes YAML Networking
Services, Ingress, NetworkPolicy, ports, and service exposure manifests.
Kubernetes YAML Config and Secrets
ConfigMap, Secret, projected volume, envFrom, and secure configuration patterns.
Kubernetes YAML Workloads
YAML patterns for Deployments, StatefulSets, DaemonSets, Jobs, CronJobs, HPAs, and PodDisruptionBudgets.