Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
runtimeVM: Calculate the WorkingSetBytes stats
WorkingSetBytes is the bit that needs to be set in order to provide kubelet the pod's memory information. Although it's calculated in a slightly different way for "oci" runtime types, the logic is quite similar for the "vm" runtime type, with the only difference being where the TotalInactiveFile information comes from. This is the last bit needed in order to have `kubectl top pod $pod` working, as shown below: ``` [fidencio@localhost cri-o]$ kubectl get pods NAME READY STATUS RESTARTS AGE example-fedora 1/1 Running 0 130m [fidencio@localhost cri-o]$ kubectl get pod example-fedora -o yaml | grep runtimeClassName {"apiVersion":"v1","kind":"Pod","metadata":{"annotations":{},"labels":{"app":"example-fedora-app"},"name":"example-fedora","namespace":"default"},"spec":{"containers":[{"args":["-m","http.server","8080"],"command":["python3"],"image":"fedora:33","name":"example-fedora","ports":[{"containerPort":8080}]}],"runtimeClassName":"kata"}} f:runtimeClassName: {} runtimeClassName: kata [fidencio@localhost cri-o]$ kubectl top pod NAME CPU(cores) MEMORY(bytes) example-fedora 1m 9Mi ``` Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
- Loading branch information