Cpu unit eEinumkKMGTP meanings

When I create ResourceQuota ,it reported error:

Error from server (BadRequest): ResourceQuota in version "v1" cannot be handled as a ResourceQuota: v1.ResourceQuota.Spec: v1.ResourceQuotaSpec.Hard: unmarshalerDecoder: quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$', error found in #10 byte of ...|:"1000abc","memory":|..., bigger context ...|espace":"default"},"spec":{"hard":{"cpu":"1000abc","memory":"200Gi","pods":"10"},"scopeSelector":{"m|...

I found that cpu and memory have unit limits. I would like to ask you, what does “eEinumkKMGTP” mean?

Cluster information:

Kubernetes version:
Cloud being used: (put bare-metal if not on a public cloud)
Installation method:
Host OS:
CNI and version:
CRI and version:

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

It’s part of a regular expression it means it’ll match any one of those characters.

Sorry, I may not be able to express clearly, I know the meaning of this error, but what I am not clear about is what each letter in the string “eEinumkKMGTP” means, I only know the meaning of a few of them, such as ‘n’ for is nano-cores, m stands for milli-cores, what do the others mean?

E and e are scientific notation for decimal exponents (e.g. 5e3 = 5000)

m is milli (thousandths 10^-3)

K is kilo (10^3)
M is mega (10^6)
G is giga (10^9)
T is tera (10^12)
P is peta (10^15)

Ki is kilo (2^10)
Mi is mega (2^20)
Gi is giga (2^30)
Ti is tera (2^40)
Pi is peta (2^50)

Thanks a lot, and what do ‘i’ and ‘k’ stand for?

I know that ‘Ki’ and ‘Mi’ are used in memory, and the same is used in cpu?

The unit of cpu is whole cores, so things like milli make sense, but things like kilo or mega do not (unless you have a 1024 core machine!!)

The unit of memory is bytes, so things like mega and giga make sense, but milli does not.

The API field here is a map from string to “quantity” so both are syntactically able to use all scalars - you can ask for a mega-core or a milli-byte, but neither will do anything useful. :slight_smile: