Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable swap and allow enabling using a settings file/Minishift command #205

Open
gbraad opened this issue Jan 30, 2018 · 6 comments
Open
Assignees

Comments

@gbraad
Copy link
Member

gbraad commented Jan 30, 2018

It seems that with later versions of OpenShift, swap needs to be disabled. See: minishift/minishift#1922 (comment)

This means that handle-user-data should not perform swapon, However, we should allow Minishift to change this behaviour... for instance by setting a config file /mnt/sda1/minishift/instanceconfig which contains a ENABLESWAP=true option, and a way to trigger this part with a script or command, much like handle-user-data and/or set-ipaddress does.

@praveenkumar
Copy link
Collaborator

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.

@praveenkumar praveenkumar self-assigned this Jan 31, 2018
@praveenkumar
Copy link
Collaborator

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   

@gbraad
Copy link
Member Author

gbraad commented Jan 31, 2018

@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.

@praveenkumar
Copy link
Collaborator

@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).

@sosiouxme
Copy link

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+.

@gbraad
Copy link
Member Author

gbraad commented Feb 7, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants