Reputation: 2310
Memory and cpu resources of a container can be tracked using prometheus. But can we track I/O of a container? Are there any metrices available?
Upvotes: 3
Views: 1702
Reputation: 5267
If you are using Docker containers you can check the data with the docker stats
command (as P... mentioned in the comment). Here you can find more information about this command.
If you want to check pods cpu/memory usage without installing any third party tool then you can get memory and cpu usage of pod from cgroup.
- Go to pod's exec mode
kubectl exec pod_name -- /bin/bash
- Go to
cd /sys/fs/cgroup/cpu
for cpu usage runcat cpuacct.usage
- Go to
cd /sys/fs/cgroup/memory
for memory usage runcat memory.usage_in_bytes
For more look at this similar question. Here you can find another interesting question. You should know, that
Containers inside pods partially share
/proc
with the host system include path about a memory and CPU information.
See also this article about Memory inside Linux containers.
Upvotes: 1