Open gbraad opened 6 years ago
I am also interested how the older version of OpenShift perform when the swap is disabled, if they work as expected then we might disable it permanently without putting another script to enable it.
Below is what we have as part of available partitions.
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 19.5G 0 disk
|-sda1 8:1 0 18.6G 0 part /mnt/sda1
`-sda2 8:2 0 1000M 0 part [SWAP]
sr0 11:0 1 330M 0 rom /run/initramfs/live
loop0 7:0 0 16K 1 loop
loop1 7:1 0 4.1M 1 loop
`-live-osimg-min 253:2 0 10G 1 dm
loop2 7:2 0 277.7M 1 loop
loop3 7:3 0 10G 1 loop
|-live-rw 253:0 0 10G 0 dm /
|-live-base 253:1 0 10G 1 dm
`-live-osimg-min 253:2 0 10G 1 dm
@praveenkumar not so sure about this... I remember having seen a ton of OOM errors before when the swap did NOT mount on a restart.
@gbraad Ack, I will hold it till we can test out 3.9.0 bits (currently downloading those bits are not working from release page).
The change is just that the kubelet now refuses to start when swap is enabled. But I don't think anything else has changed, practically speaking, with v3.8.
The logic behind this is for real cluster usage, you don't want to be swapping; you want to allocate pods with an accurate idea of the resources available to actually run and use memory pressure to affect scheduling pods accordingly. That's kind of irrelevant on a single-node test cluster, so it might be valid to simply configure the kubelet to start anyway when swap is disabled.
On the other hand, if you're getting OOMs without swap enabled, maybe that's a sign you really do need more real memory as a default for the VM instead of swap.
Whatever the outcome is, IMHO there's no need to have different defaults for v3.6 vs v3.8+.
However, if no different defaults it means we have to deploy v3.8 with skipping the swap check.
It seems that with later versions of OpenShift, swap needs to be disabled. See: https://github.com/minishift/minishift/issues/1922#issuecomment-360832745
This means that
handle-user-data
should not performswapon
, However, we should allow Minishift to change this behaviour... for instance by setting a config file/mnt/sda1/minishift/instanceconfig
which contains aENABLESWAP=true
option, and a way to trigger this part with a script or command, much likehandle-user-data
and/orset-ipaddress
does.