Concept
Every node has its own capacity of resources (CPU and memory). When you deploy a pod, it consumes the node’s resources. The kube-scheduler is responsible for scheduling pods to nodes. It identifies the node with the required resources to deploy the pod. If a node does not have the required resources, the pod will be in pending state.Resource Requests
Resource requests are the minimum amount of CPU or memory guaranteed to a container. By default, every pod has a default request of 0.5 CPU and 256MB of memory. CPU units:0.1CPU =100m(milli)1 CPU = 1 vCPU (AWS) = 1 Core (GCP, Azure) = 1 Hyperthread
| Binary | Bytes |
|---|---|
| 1G (Gigabyte) | 1,000,000,000 |
| 1M (Megabyte) | 1,000,000 |
| 1K (Kilobyte) | 1,000 |
| 1Gi (Gibibyte) | 1,073,741,824 |
| 1Mi (Mebibyte) | 1,048,576 |
| 1Ki (Kibibyte) | 1,024 |
pod.yaml
Resource Limits
Resource limits are the maximum amount of CPU or memory a container can use. By default, every pod has a default limit of 1 CPU and 512MB of memory. If a pod exceeds its limits:- CPU: The system throttles the CPU so it does not go beyond the limit.
- Memory: The system kills the container with an OOM (Out of Memory) error.
pod.yaml