Run a replicated stateless workload.
Section: Deployments
Basic Deployment YAML
yaml
yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: api
spec:
replicas: 3
selector:
matchLabels:
app: api
template:
metadata:
labels:
app: api
spec:
containers:
- name: api
image: ghcr.io/example/api:1.0.0
ports:
- containerPort: 8080Explanation
Deployments manage ReplicaSets and provide declarative rollout behavior for 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 Deployments