Resource profiles define the computational requirements of Pods through requests and limits. These profiles are fundamental to Kubernetes scheduling, quality of service, and capacity planning.
Resource Types
Kubernetes manages two categories of resources with fundamentally different behaviors:
Compressible Resources
CPU - Can be throttled without killing the process. If a container exceeds its CPU limit, Kubernetes throttles it to the limit but the container continues running.
cpu-shares - Relative CPU weights when the node is under contention.
Incompressible Resources
Memory - Cannot be compressed or throttled. If a container exceeds its memory limit, Kubernetes kills it (OOMKilled - Out Of Memory).
ephemeral-storage - Temporary disk space. Exceeding limits triggers Pod eviction.
hugepages - Large memory pages for performance-critical applications.
This distinction shapes how Quality of Service classes work and how Pods behave under resource pressure.
Requests vs Limits
Requests specify the minimum resources guaranteed to a container:
- Used by scheduler to find suitable nodes
- Guaranteed to be available to the container
- Sum of all requests determines if a Pod can fit on a node
Limits specify the maximum resources a container can use:
- Enforced by the kubelet via cgroups
- Exceeding CPU limits causes throttling
- Exceeding memory limits causes termination
- Can be higher than requests (burstable) or equal (guaranteed)
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
Quality of Service
The relationship between requests and limits determines a Pod’s QoS class:
Guaranteed - requests = limits for all resources Burstable - requests < limits for some resources BestEffort - no requests or limits specified
QoS class determines Pod priority during eviction when nodes run out of resources.
Scheduling Implications
Resource profiles are critical runtime dependencies. The scheduler:
- Looks at Pod resource requests (not limits)
- Finds nodes with enough unreserved capacity
- Binds Pod to a suitable node
If no node has sufficient resources, the Pod remains Pending. Pod priority can trigger preemption to make room.
Capacity Planning
Resource profiles enable effective capacity planning:
Right-sizing - Profile containers accurately to avoid over-provisioning or resource starvation.
Vertical Pod Autoscaler (VPA) - Analyzes actual usage and recommends request/limit adjustments, helping tune profiles based on real behavior.
Horizontal scaling - With accurate profiles, you can calculate how many replicas fit on available capacity.
Namespace quotas - ResourceQuotas aggregate these profiles to limit total namespace consumption.
Common Patterns
Production workloads - Use Guaranteed QoS (requests = limits) for predictable performance.
Batch jobs - Use Burstable with low requests but high limits to take advantage of idle capacity.
Development - May use BestEffort to maximize cluster utilization, accepting eviction risk.