<p>Stats found in cgroup files on the host, are they reliable if the container does not share the kernel with the host?</p>

<p>I'm asking this because while it was reliable with docker, with multiple runtimes being supported by K8s - some that offer containers with their own kernels, should I rely on the runtime daemons for stats or can I bypass them and still look at cgroup files.</p>

Sam Thomas
<p>If you are referring to Kata Containers with Docker and Kubernetes the short answer is yes. Make sure you configure <code>sandbox_cgroup_only=true</code> to get the accurate stats.</p>
<p>Also, make sure you use Kata Containers <code>1.11.0</code> or later as <a href="https://github.com/kata-containers/runtime/pull/2441" rel="nofollow noreferrer">the cgroups implementation fix</a> went into that version. Kata Containers creates its own cgroups in the Kernel running in the VM but that matches what's created at the host level. The resources for these cgroups created at the host level are not used, but rather the resources allocated by the VMM. Some more info <a href="https://github.com/kata-containers/runtime/issues/2500" rel="nofollow noreferrer">here</a>.</p>
