Define a basic Deployment resource in YAML.
Section: Kubernetes YAML patterns
Minimal Kubernetes Deployment
yaml
yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: expressyou-api
spec:
replicas: 2
selector:
matchLabels:
app: expressyou-api
template:
metadata:
labels:
app: expressyou-api
spec:
containers:
- name: api
image: us-central1-docker.pkg.dev/project/repo/api:latest
ports:
- containerPort: 8080Explanation
Kubernetes YAML is one of the most practical and searched YAML use cases.
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 Kubernetes YAML patterns
Preview resource changes
Show what would change before applying a manifest.
Inspect Kubernetes manifest fields
Read documentation for manifest fields from the terminal.