Resource Limits & CPU/RAM
Configure CPU and Memory requests (minimum required reserved resources) and limits (maximum allowed threshold) for containers.
1. Requests vs Limits
Requests (Guaranteed Reserve)
Minimum CPU & RAM required for Kube-scheduler to place the Pod on a node. Used for node capacity calculations.
Limits (Hard Ceiling Threshold)
Maximum CPU & RAM allowed. CPU is throttled if exceeded; Memory causes container OOMKilled (Exit Code 137) restart!
2. Production Resource Spec Example
containers:
- name: node-api
image: node-api:latest
resources:
requests:
cpu: "250m" # 0.25 CPU Cores
memory: "256Mi" # 256 Megabytes RAM
limits:
cpu: "500m" # 0.50 CPU Cores
memory: "512Mi" # 512 Megabytes RAMNext Up
Learn Auto-scaling: Horizontal Pod Autoscaler (HPA), Metrics Server, and Vertical Pod Autoscaler (VPA).
Next Lesson: Auto-scaling (HPA & VPA) →