1

Kubernetes spits memory limit warnings at me, even though the memory of the node is not exhausted in any measure - neither by kubernetes stastics and even less by system statistics:

root@ftt:local-storage :) $ free -h
               total        used        free      shared  buff/cache   available
Mem:            46Gi        16Gi       2.4Gi       439Mi        28Gi        29Gi
Swap:             0B          0B          0B
root@ftt:local-storage :) $ kubectl top node
NAME   CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%   
ftt    552m         13%    33815Mi         70%   
xeruf
  • 115
  • 6

1 Answers1

1

Quoting an answer from another StackOverflow thread:

Found answer to my question here: The memory usage reported in cgroup differs from the free command. In summary, it seems that Kubernetes uses the cgroup memory utilisation, which is reported in /sys/fs/cgroup/memory/memory.usage_in_bytes. The cgroup memory utilisation calculates not only the currently used memory in RAM, but also the "cached" memory (i.e. any memory no longer required by apps that are subsequently free to be reclaimed by the OS, but hasn't been reclaimed yet). The Linux system commands see "cached" memory as "free" but Kubernetes does not (not sure why).

Here's another Server fault thread that discusses the same topic- kubectl top command output does not match Linux free command.

lsalazar
  • 161
  • 4