This error occurs when a container's CPU request is below the namespace LimitRange minimum. Fix it by increasing the CPU request to meet or exceed the minimum constraint defined in the LimitRange.
The "minimum cpu usage per Container" error indicates that your container's CPU request is below the minimum threshold enforced by a LimitRange in the namespace. LimitRanges set constraints on resource requests and limits that all containers must satisfy. When a LimitRange specifies a minimum CPU (e.g., 200m), any container requesting less than that amount will be rejected at admission time. This ensures all workloads in the namespace have a baseline level of resources. This error occurs at Pod admission—the API server validates the Pod spec against LimitRange constraints before accepting it. Existing pods are unaffected by LimitRange changes.
View the LimitRange constraints:
kubectl get limitrange -n <namespace>
kubectl describe limitrange <name> -n <namespace>Output shows:
- min.cpu: Minimum CPU request allowed
- max.cpu: Maximum CPU limit allowed
- default: Default limit applied
- defaultRequest: Default request applied
Check which container violates the minimum:
# Try to apply and see detailed error
kubectl apply -f pod.yaml
# Check pod events if partially created
kubectl describe pod <pod-name> -n <namespace>Error message will show the container name and values.
Increase the CPU request to satisfy the LimitRange:
# Before (fails if min.cpu is 200m)
resources:
requests:
cpu: 100m
# After (meets minimum)
resources:
requests:
cpu: 200m
memory: 128Mi
limits:
cpu: 500m
memory: 256MiApply the corrected manifest:
kubectl apply -f pod.yaml -n <namespace>For Deployments, update the pod template:
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
template:
spec:
containers:
- name: app
image: my-image
resources:
requests:
cpu: 250m # Above minimum (200m)
memory: 256Mi
limits:
cpu: 1000m
memory: 1GiRedeploy:
kubectl apply -f deployment.yaml
kubectl rollout status deployment/my-app -n <namespace>Confirm the pod was created with correct resources:
kubectl get pods -n <namespace> -w
# Verify resource allocation
kubectl describe pod <pod-name> -n <namespace> | grep -A3 "Requests"Should show CPU request meeting or exceeding the minimum.
If the minimum is too high for your workload, request admin change:
apiVersion: v1
kind: LimitRange
metadata:
name: cpu-limit-range
namespace: <namespace>
spec:
limits:
- type: Container
min:
cpu: 100m # Lowered from 200m
max:
cpu: 2
default:
cpu: 500m
defaultRequest:
cpu: 100mAdmin applies the updated LimitRange. Only affects new pods.
LimitRange Types:
- Container: Per-container constraints
- Pod: Total across all containers
- PersistentVolumeClaim: Storage size constraints
Default Fields:
- min: Hard floor—requests cannot be lower
- max: Hard ceiling—limits cannot be higher
- default: Applied as limit if not specified
- defaultRequest: Applied as request if not specified
- maxLimitRequestRatio: Maximum ratio of limit/request
Key Behaviors:
- LimitRange validation happens only at Pod admission
- Existing pods are unaffected by LimitRange changes
- Limits must always be >= requests
- Each container in multi-container pods must independently meet constraints
Common Real-World Minimums:
- Development: 50m CPU, 32Mi memory
- Production: 250m CPU, 256Mi memory
Service port already allocated
How to fix "Service port already allocated" in Kubernetes
Failed to connect to server: connection refused (HTTP/2)
How to fix "HTTP/2 connection refused" error in Kubernetes
No subnets found for EKS cluster
How to fix "eks subnet not found" in Kubernetes
missing request for cpu in container
How to fix "missing request for cpu in container" in Kubernetes HPA
unable to compute replica count
How to fix "unable to compute replica count" in Kubernetes HPA