You are on page 1of 3

#k8s

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

fix-point number Power-of-two equivalent

E Ei

P Pi

T Ti

G Gi

M Mi

k Ki

Local Ephemeral Storage


storage that last a very short time
Pods use ephemeral local storage for
scratch space
caching
logs
Container files.
EmptyDir storage and k8s cluster data reside on the root file system of the host
node.
kubelet can provide scratch space to Pods using local ephemeral storage to mount
emptyDir volumes into container
kubelet also uses this kind of storage to hold node-level container logs, container
images, writable layers of running containers
The Scheduler will only choose a node with enough space to meet the sum of all
the container requests
k8s let you track, reserve and limit the amount of ephemeral local storage a Pod
can consume
If a container, or the sum of containers in a pod use more than the limit, Pod will
be evicted
Settings:
spec.containers[].resources.limits.ephemeral-storage
spec.containers[].resources.requests.ephemeral-storage

hugepage
You can not over-commit hugepages-* resources.
spec.containers[].resources.limits.hugepages-<size>
spec.containers[].resources.requests.hugepages-<size>
Ex: hugepages-2Mi: 80Mi

You might also like