[英]Is parsing cgroup files for stats viable if the container is not sharing the kernel with host?
Stats found in cgroup files on the host, are they reliable if the container does not share the kernel with the host?在主机上的 cgroup 文件中找到的统计信息,如果容器不与主机共享内核,它们是否可靠?
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.我问这个是因为虽然它对 docker 来说是可靠的,但 K8s 支持多个运行时 - 有些提供带有自己内核的容器,我应该依赖运行时守护进程来获取统计信息还是我可以绕过它们并仍然查看 cgroup 文件.
If you are referring to Kata Containers with Docker and Kubernetes the short answer is yes.如果您指的是带有 Docker 和 Kubernetes 的 Kata Containers,那么简短的回答是肯定的。 Make sure you configure
sandbox_cgroup_only=true
to get the accurate stats.确保配置
sandbox_cgroup_only=true
以获取准确的统计信息。
Also, make sure you use Kata Containers 1.11.0
or later as the cgroups implementation fix went into that version.此外,请确保您使用 Kata Containers
1.11.0
或更高版本,因为cgroups 实现修复进入该版本。 Kata Containers creates its own cgroups in the Kernel running in the VM but that matches what's created at the host level. Kata Containers 在 VM 中运行的内核中创建自己的 cgroup,但这与在主机级别创建的内容相匹配。 The resources for these cgroups created at the host level are not used, but rather the resources allocated by the VMM.
在主机级别创建的这些 cgroup 的资源没有被使用,而是由 VMM 分配的资源。 Some more info here .
这里有更多信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.