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

Replace Ubuntu Server with Alpine Linux #22

Closed
jiayihu opened this issue Dec 8, 2020 · 6 comments
Closed

Replace Ubuntu Server with Alpine Linux #22

jiayihu opened this issue Dec 8, 2020 · 6 comments
Labels
enhancement New feature or request fedra-compute

Comments

@jiayihu
Copy link
Owner

jiayihu commented Dec 8, 2020

Current OS is Ubuntu Server 20.04 as done in #18 but Alpine Linux is much smaller, although requires much more initial configuration. Alpine Linux requires only about 130MB storage, 8MB RAM.

Alpine Linux for Raspberry Pi aarch64 is available at https://alpinelinux.org/downloads/

@jiayihu jiayihu added enhancement New feature or request fedra-compute labels Dec 8, 2020
@jiayihu
Copy link
Owner Author

jiayihu commented Dec 12, 2020

@jiayihu
Copy link
Owner Author

jiayihu commented Dec 12, 2020

I gave a shot at persistent storage as described in https://wiki.alpinelinux.org/wiki/Raspberry_Pi_4_-_Persistent_system_acting_as_a_NAS_and_Time_Machine but I had an issue where wlan0 device could not be found after reboot. Sticking with immutable storage is fine for the time being, I can revert to previous configs and be sure that a reboot resets to the last working config

@jiayihu
Copy link
Owner Author

jiayihu commented Dec 12, 2020

It also seems that it's not possible to create an user. The changes are not committed and even so they are recreated as root after reboot. https://gitlab.alpinelinux.org/alpine/aports/-/issues/10124

@jiayihu
Copy link
Owner Author

jiayihu commented Dec 13, 2020

K3s server doesn't seem to be working on Alpine Linux due to missing storage. I cannot add cgroup config to extlinux, which is not available in diskless. So I must find a way to mount persistent storage, maybe as described here: https://wiki.alpinelinux.org/wiki/Raspberry_Pi#Persistent_storage

Anyway memory cgroups seems not work neither: https://gitlab.alpinelinux.org/alpine/aports/-/issues/11308

@jiayihu
Copy link
Owner Author

jiayihu commented Dec 14, 2020

Final status: all nodes have been migrated to Alpine Linux. The final status is a diskless mode with persistent overlay in /usr, /var/lib/rancher and /root up to 1GB. Maybe I should have used 2-3GB (4GB is the upper bound of FAT32), but 1GB should be enough. The important files are backed up and immutable, at worst data in overlay can be deleted and the cluster reset (including tokens and certs).

The memory usage of Alpine w/o k3s is 55MB, compared to about ~400MB for Ubuntu Server. With k3s-server it's up to ~500MB in the master, because Go is garbage collected and it prefers to increase the memory if available instead of running the collector. Worker nodes with k3s agent use ~128MB.

@jiayihu jiayihu closed this as completed Dec 14, 2020
@jiayihu
Copy link
Owner Author

jiayihu commented Dec 14, 2020

Opened PR in k3s-ansible adding support for Alpine Linux k3s-io/k3s-ansible#107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fedra-compute
Projects
None yet
Development

No branches or pull requests

1 participant