Kubernetes YAML Cheat Sheet/Minimal Pod manifest

Smallest practical Pod YAML shape.

Section: Manifest Basics

Minimal Pod manifest

yaml
yaml
apiVersion: v1
kind: Pod
metadata:
  name: demo-pod
  labels:
    app: demo
spec:
  containers:
    - name: app
      image: nginx:1.27
      ports:
        - containerPort: 80
Explanation

A Kubernetes object is typically expressed as YAML with `apiVersion`, `kind`, `metadata`, and `spec`. Pods are usually used directly only for debugging or one-off workloads; Deployments are better for managed application Pods.

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 Manifest Basics
Multiple resources in one YAML file
Separate resources with `---`.
OpenIn sheetyamlsame section
Apply YAML file
Create or update resources from a YAML file.
OpenIn sheetbashsame section
Apply YAML directory
Apply all manifests in a directory.
OpenIn sheetbashsame section
Preview manifest changes
See what apply would change.
OpenIn sheetbashsame section
Override container command and args
Set entrypoint-style command in YAML.
OpenIn sheetyaml1 tag match
Labels and annotations example
Common metadata block for selectors and tooling.