Configure proper resource requests and limits to prevent resource starvation in production clusters
Without proper resource configuration, pods can consume unlimited CPU and memory, leading to node exhaustion, OOM kills, and application instability in production.
Set appropriate resource requests and limits to guarantee minimum resources while preventing runaway consumption. Requests ensure scheduling, limits prevent abuse.
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-service
spec:
containers:
- name: app
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "500m"