There are two examples on kubernetes.io about how to specify memory request and limits and they are very confusing.
(I removed cpu
and the unnecessary quote characters from the following examples.)
Example 1:
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
resources:
requests:
memory: 64Mi
limits:
memory: 128Mi
Example 2:
https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/
resources:
limits:
memory: 200Mi
requests:
memory: 100Mi
Both examples are valid expressions but when using power-of-two suffix shouldn't you aim for always using 8
, 16
, 32
, 64
, 128
, 256
, 512
, 1028
and so on?
I think that the person from example nr 2 didn't really know what she/he was doing and she/he should have used fixed-point suffix, 200M
and 100M
, instead?
If I were to specify 268435456
bytes using power-of-two suffix how would I express that in my yaml config; 250Mi
or 256Mi
?
100Mi
is 104,857,600 bytes; there's nothing syntactically or semantically wrong with it as a limit, and it's about 20% less memory than128Mi
. – David Maze