Overcommit — allocate more resources than physically available.
1# Node with overcommit2apiVersion: v13kind: Node4metadata:5 name: node-16 labels:7 node-type: overcommit8spec:9 taints: []10---11# Pods requesting more than node capacity12apiVersion: apps/v113kind: Deployment14metadata:15 name: overcommit-app16spec:17 replicas: 2018 template:19 metadata:20 labels:21 app: overcommit22 spec:23 containers:24 - name: app25 image: nginx:latest26 resources:27 requests:28 cpu: "500m" # Total: 20 * 500m = 10 CPU29 memory: "256Mi" # Total: 20 * 256Mi = 5Gi30 limits:31 cpu: "1000m"32 memory: "512Mi"
1# Check node capacity vs allocated2kubectl describe node node-1 | grep -A 5 "Allocated resources"34# Check overcommit ratio5kubectl get node node-1 -o jsonpath='{.status.capacity}' | jq6kubectl get node node-1 -o jsonpath='{.status.allocatable}' | jq78# Check actual resource usage9kubectl top nodes10kubectl top pods --sort-by=cpu1112# Monitor resource pressure13kubectl get nodes -o custom-columns=NAME:.metadata.name,MEMORY_PRESSURE:.status.conditions[?(@.type=="MemoryPressure")].status14kubectl get nodes -o custom-columns=NAME:.metadata.name,CPU_PRESSURE:.status.conditions[?(@.type=="PIDPressure")].status1516# Check eviction events17kubectl get events --field-selector reason=Evicted
Overcommit Strategies:
Risks: