Does a secure (Kata) pod see the node's CPU and memory, or only its VM's?
Only its VM's. A pod with runtimeClassName: secure runs in its own VM, and the processes in it see the VM's vCPUs and memory, never the node's. nproc and /proc/cpuinfo count the VM's vCPUs, and free and /proc/meminfo show the VM's memory.
Pods on the shared-kernel runtimes, standard and runc, are different: they see the node's CPUs and memory in /proc, whatever their limits.
How big the VM is
The VM is sized once, when the pod starts, from the pod's limits:
- vCPUs: 1, plus the pod's CPU limits rounded up to whole vCPUs. A pod without CPU limits gets 1 vCPU.
- Memory: 256 MiB, plus the pod's memory limits. A container without a memory limit gets a default limit of 512Mi.
All containers of the pod share the one VM, so each of them sees the same vCPUs and memory. Each container's own memory limit still applies inside the VM.
The memory a pod sees is 100 to 170 MiB less than its VM's size, because the guest kernel reserves that memory. The bigger the VM, the more it reserves.
Related
- Size a secure pod shows what a pod sees for common limits, and covers the pod overhead, the default memory limit, and resizing a running pod.
- Can we add a custom container runtime (gVisor, Kata)?
Related questions
