Kubernetes insists that you disable swap. The reason is that swap messes with the accounting of memory usage. Kubernetes expects hosts to have a very direct action memory reservation. Containers have a memory request; if they are over this request when memory pressure hits, they will be killed. Because the swapped out pages are not included in the memory accounting[1] you can end up in states where nothing is over the request, even though you theoretically haven't overcommitted. This requires falling back to true random killing, which is to be avoided.
It's also based on observations of performance - for many moons, the performance hit of swapping was bad enough that it was never worth it to run two jobs concurrently that didn't both fit into ram together. The exceptions weren't even exceptions. Disk thrashing was a serious impediment and way to slow your whole fleet down.
Now with fast flash being so common, swap is probably actually a good thing for many workloads again, but only "many", and SREs would prefer you make that explicit by using memory mapped files for data that's of random utility, so that the OS can manage that pressure for you, understanding that those files don't need to be fully resident.
[1] This is an oversimplification that I don't remember the real truth of off the top of my head
It's also based on observations of performance - for many moons, the performance hit of swapping was bad enough that it was never worth it to run two jobs concurrently that didn't both fit into ram together. The exceptions weren't even exceptions. Disk thrashing was a serious impediment and way to slow your whole fleet down.
Now with fast flash being so common, swap is probably actually a good thing for many workloads again, but only "many", and SREs would prefer you make that explicit by using memory mapped files for data that's of random utility, so that the OS can manage that pressure for you, understanding that those files don't need to be fully resident.
[1] This is an oversimplification that I don't remember the real truth of off the top of my head