Professional Documents
Culture Documents
k8s Resources Type
k8s Resources Type
Background
Each resource type has a base unit
For linux workloads, you can specify huge page resources
CPU and memory are referred to as computer resources (or resources)
Types of Resources
CPU
Traits
Fractional requests are allowed. Ex: spec.containers[].resources.cpu: 0.5
If a container use more resources than allowed, it won’t be killed
If the limits are set to the pod instead of a container, all usage of the containers
is considered and all containers are throttled at the same time
Unit
CPU requests are made in CPU units
Each unit being a millicore
Each millicore is not evaluate
So using more than the limit is possible
The exact amount of overuse is not defined
CPU value is absolute - not relative. One CPU in k8s equals to
1 AWS vCPU
1 GCP Core
1 Azure vCore
1 Hyperthread on a bare-metal intel processor with Hyperthreading
Settings
spec.containers[].resources.limits.cpu
spec.containers[].resources.requests.cpu
Memory (RAM)
Traits
The handling of a container which exceeds its memory limit is not definite
It may be restarted
Or if it asks for more than the memory request setting, the entire pod might
be removed from the node
Settings
spec.containers[].resources.limits.memory
spec.containers[].resources.requests.memory
Unit
measured in bytes
You can express using
plan integer
fixed-point number using the following quantity suffixes
E Ei
P Pi
T Ti
G Gi
M Mi
k Ki
hugepage
You can not over-commit hugepages-* resources.
spec.containers[].resources.limits.hugepages-<size>
spec.containers[].resources.requests.hugepages-<size>
Ex: hugepages-2Mi: 80Mi