How Kubernetes measures CPU
A CPU request or limit is a quantity: a number followed by at most one suffix. One CPU is one physical core or one virtual core, depending on whether the node is a physical machine or a virtual machine.
The suffix m means thousandths, called millicores, so 0.1 and 100m are the same request. Nothing finer than 1m is allowed: 0.1m is rounded up to 1m.
| Millicores | Cores |
|---|---|
| 100m | 0.1 |
| 250m | 0.25 |
| 500m | 0.5 |
| 1000m | 1 |
| 1500m | 1.5 |
| 2000m | 2 |
CPU is an absolute amount, never a share of the node. The docs say 500m is roughly the same computing power on a single-core, dual-core or 48-core machine.
The format is the same on every provider, because it comes from the Kubernetes API: 250m is a quarter of a CPU on EKS, GKE and AKS. What differs is how much of each node is left for pods, which the Kubernetes allocatable calculator compares.
Worked example: 1.5 cores
Say a container needs one and a half cores. You can write 1.5 or 1500m: they are the same request, and Kubernetes stores both as 1500m. On a 4-core node, that request is 1.5 ÷ 4 = 37.5% of the CPU.
Whole cores go the other way. 2000m comes back as 2, because the canonical form uses the largest suffix that keeps the value exact.
Pitfall: 500M is not 500m
Suffixes are case-sensitive. The costly mistakes are the ones the API server accepts, because you get no error when you apply them:
500Mis 500 million cores:Mmeans millions, andmmeans thousandths.500is 500 cores, since a number with no suffix counts whole CPUs.
The fix for both is 500m, and the calculator warns about each. A request too large for any node leaves the pod in Pending with a FailedScheduling event, unless a LimitRange rejects it first. Other typos do fail at once: 1K and 500 m are not valid quantities.
Canonical form and noisy diffs
Kubernetes accepts many spellings of one value. The reference says it writes each one back in canonical form: no fractional digits, and the largest suffix that keeps the value exact. 0.5 comes back as 500m, and 1000m as 1. A few unusual spellings come back as typed, such as +1, 1E3 and 1.500.
The reference sums it up as "always use canonical form, or don't diff". If a tool that compares your manifest with the live object keeps flagging a CPU value that nobody changed, copy the canonical form above into the manifest. For memory values, use the Kubernetes memory units converter. To see how requests add up on a node, use the Kubernetes pod capacity calculator.
FAQ
What does 500m mean for Kubernetes CPU?
500 millicores, which is half a CPU. One CPU is 1000m, so 500m and 0.5 are the same amount, and Kubernetes stores both as 500m. One CPU means one physical core or one virtual core, depending on whether the node is a physical machine or a virtual machine.
How many millicores are in one core?
1000. So 100m is 0.1 cores, 250m is 0.25 cores, and 1500m is 1.5 cores. To go from cores to millicores, multiply by 1000.
What does 500M of CPU mean?
500 million cores. Suffixes are case-sensitive: M means millions and m means thousandths. The value is a valid quantity, so you get no parsing error. A request too large for any node leaves the pod in Pending, unless a LimitRange rejects it first. You almost certainly meant 500m.
What is the smallest CPU request in Kubernetes?
The smallest non-zero value is 1m, or 0.001 CPU. The resource management docs say Kubernetes does not allow anything finer. The Quantity reference says finer values are rounded up, so 0.1m becomes 1m.
Are Kubernetes CPU units different on EKS, GKE and AKS?
No. The format comes from the Kubernetes API, so 250m is a quarter of a CPU on all three. What differs is everything around the format: how much CPU each provider reserves on a node, and the hardware behind one vCPU, which depends on the machine type. EKS Fargate also rounds a pod up to its supported sizes, and GKE Autopilot can raise requests to fit its rules.
Why does kubectl show a different CPU value from the one I applied?
Kubernetes normally rewrites a quantity in canonical form when it serializes it: no fractional digits, and the largest suffix that keeps the value exact. So 1.5 comes back as 1500m, and 1000m comes back as 1. The amount is the same, but tools that compare text will report a difference. Writing the canonical form in your manifests avoids that.