in your Kubernetes installation, otherwise you will see the following error • Running with swap on is not supported, please disable swap! Or set — fail-swap-on f lag to false • [ERROR Swap]: running with swap on is not supported, Please disable swap
buffer for running more applications when physical memory is insuf f icient • Increase system stability • Helps prevent system crashes due to memory shortages (OOM)
memory management algorithm, such as oomd which strongly recommend the use of swap. • Having a small amount of swap could improve resource pressure handling and recovery.
on swap for optimal performance. • Initialization logic of applications can be safely swapped out without affecting long-running application resource usage.
Virtualize k8s workloads such as VMs launched by Kubevirt • VM comes with a management related overhead • Swap help to not request much more memory to deal with. • Live migration to make system available instead of down
Virtualize k8s workloads such as VMs launched by Kubevirt • VM comes with a management related overhead • Swap help to not request much more memory to deal with. •
a node’s host system, but kubelet doesn’t not permit K8s workloads to use swap -> case 1 • Kubernetes can permit K8s workload scheduled on the node to use some quantity of swap, depending on the con f iguration -> case 2
swap support only for Burstable QoS Pods • No guaranteed • Performance penalty. • No Best-Effort • Low-priority pods that are f irst to be killed during node press.
with swap on • Case 1 or 2 • Kubelet is able to set swap utilization to K8s workloads, default to 0 swap. • Use a swap memory for cgroups v2 • I/O isolation support
daemons(kubelet) • Setting the cgroup for the system slice to avoid swap. • cgroup v2 • memory.swap.max = 0 • Setting up the io.latency • cgroup v2 • io.latency to adjust the priority, should higher than workload
Enabling swap on nodes is advanced con f iguration which needs the understanding of the Linux system. • —fail-swap-on=true still the 1st option for most cases of K8s
node with swap on by default. • Swap behavior is UnlimitedSwap by default if we enable it. • Two options • LimitedSwap • Only Burstable Pod can use it • UnlimitedSwap • Allow for all pods.
running on node with swap on. • Swap behavior is NoSwap by default. • NoSwap • NoSwap means no k8s workload can use swap, as no-swap experience, but system can have swap for other use case. • LimitedSwap • Only burstalbe Pods can use it.
the performance and stability. • Those are natural properties in the virtual machine environment • Container’s lightweight isolation make us rework again. • Still not able to replace all VM’s environment unless you know nothing about OS tuning