https://drive.google.com/file/d/1aCCxjiwfzxO8R3911myUQtRO7HMZNr2B/view?usp=sharing
apiVersion: v1
kind: Pod
metadata:
name: nnappone
namespace: learning
labels:
app: nnappone
spec:
containers:
- name: crackone-app
image: nginx
resources:
requests:
cpu: "4" # β Wants 4 full CPU cores
limits:
cpu: "4" # β Also limits to 4 cores
β οΈ Key Issue:
The Pod requests 4 CPU cores β but most dev clusters (Minikube, Kind, Docker Desktop) have only 2β4 CPUs TOTAL, and system pods (kube-system) already use some.
π« Result: No node has 4 free CPUs β Pod canβt be scheduled.
kubectl apply -f pod-with-cpu-exceed.ymlPending state forever.0/1 nodes are available: 1 Insufficient cpu.π‘ Important:
This is a scheduling failure β not a runtime crash.
The container never starts.
# 1. Create namespace
kubectl create namespace learning
# 2. Apply the Pod
kubectl apply -f pod-with-cpu-exceed.yml
# 3. Check Pod status
kubectl get pods -n learning
# β
Expected output:
# NAME READY STATUS RESTARTS AGE
# nnappone 0/1 Pending 0 10s
# 4. Describe Pod β look for scheduling events
kubectl describe pod nnappone -n learning
# π Look for this critical line in "Events":
# Type Reason Age From Message
# ---- ------ ---- ---- -------
# Warning FailedScheduling 5s default-scheduler 0/1 nodes are available: 1 Insufficient cpu.
# See total & allocatable CPU on nodes
kubectl describe nodes | grep -A 5 -B 5 "Capacity\\\\|Allocatable"
# Example output (Minikube with 2 CPUs):
# Capacity:
# cpu: 2
# Allocatable:
# cpu: 2
π Allocatable CPU = Total CPU β reserved for system/kubelet
β If allocatable = 2, you canβt schedule a 4-CPU Pod.