Kubernetes quantities

Paste cpu: and memory: lines straight from YAML to total each resource.

How quantities work

CPU is in cores: 1 is one core and 500m is half a core. Memory is in bytes: Ki, Mi, Gi and Ti are powers of 1024, while k, M, G and T are powers of 1000, so 128M is about 122Mi.

A lowercase m always means thousandths, so memory: 400m is 0.4 bytes. There is no uppercase K, and no B on the end.

The canonical form is how kubectl get -o yaml prints a quantity.