Understanding Kubernetes Resource (CPU and Memory) Units
In your Kubernetes journey, at some point you will probably deal with specifying how much of particular resources you need for containers, and two of the most common are resource limits and resource requests.
For both these limits and requests — and I’ll have another article digging deeper into those — you are able to set memory
and cpu
values.
Let’s take a look at the following pod YAML file for an example of this.
This article will go over the different units that you’re able to use in the memory
and cpu
fields. Spoiler alert: Mi
and m
, respectively, are not all that you are limited to.
Memory Units
Memory units are represented by the number of bytes.
With an Explicit Integer
So as a value, you could literally put 128974848
, which means you are exactly specifying the number of bytes.