kubernetes / kubernetes/kubectl
`kubectl describe` sometimes shows memory in millibytes
- Dominant language
- Go
- Stars
- 3.3k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
via `kubectl describe node XXX`:
This can happens when some pods request sub-byte memory accidentally.
I saw a pod requesting `0.1Gi` of memory.
```yaml
requests:
cpu: 1m
memory: 0.1Gi
```
which shows up in kubernetes as:
```yaml
limits:
cpu: "4"
memory: 4Gi
requests:
cpu: 1m
memory: 107374182400m
```
This phenomenon happens here because 10 does not divide a perfect power of 2:
```js
> 0.1*1024*1024*1024*1000
107374182400
```
This sub-byte number propagates throughout and is visible in the `descibe node` output as above, as well as the `describe pod` output.
**Expected Behaviour**:
Rounding to nearest actual unit (bytes) or a human readable output with 3 significant digits on the biggest unit.
**Environment**:
EKS 1.29, kubectl client at 1.30.0
Contributor guide
Assessment
This issue has not been assessed yet.