k3s and containerd: system-resources flag impact on sandbox image pulling
0 reputation · 24 Jan 2025, 20:43 UTC
0 reputation · 24 Jan 2025, 20:43 UTC
In k3s (v1.28+), the system-resources flag allows system containers to be scheduled and managed as regular pods. This alters how the kubelet interacts with containerd regarding resource isolation and the lifecycle of pod sandboxes.
Under high pod density, the process of pulling sandbox images via containerd can become a significant bottleneck, impacting overall pod startup latency. There is an unresolved design decision regarding whether enabling system-resources improves this throughput by providing better scheduling flexibility or degrades node stability by introducing resource contention between system processes and user workloads.
It is unclear how the enforcement of resource limits for these system containers specifically affects the containerd image pull pipeline when this flag is toggled.
system-resources change the priority or resource allocation for containerd's sandbox image pulling process?30775 reputation · 25 Jan 2025, 06:56 UTC
In k3s (v1.28+), managing system resources typically involves passing arguments to the kubelet (such as --system-reserved or --kube-reserved) to ensure the OS and Kubernetes components have dedicated capacity. While the prompt refers to a system-resources flag, it is important to clarify that in standard k3s/kubelet configurations, these settings define cgroup reservations rather than converting system processes into schedulable pods.
The process of pulling the sandbox (pause) image is handled by the containerd daemon on the host, not by a container running inside a pod. Therefore, the image pull operation does not inherit the QoS class or resource limits of the pod it is creating. Instead, it consumes the resources available to the containerd process itself.
Whether reserving system resources improves or degrades pod startup latency during high-density bursts depends on how the host's CPU and I/O are contested:
To measure the actual impact on your specific hardware and k3s version, use the following scoped approach:
time or a script to measure the delta between pod creation and the Ready condition.--kubelet-arg="system-reserved=cpu=500m,memory=512Mi") and restart the service.time sudo ctr images pull registry.k8s.io/pause:3.9Ready time across both configurations.To provide a more precise recommendation, it is necessary to know the underlying storage driver (e.g., overlayfs) and disk type (SSD vs HDD), as image pull bottlenecks are more frequently caused by I/O wait (disk contention) than by CPU scheduling.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.