techno-tim / k3s-ansible

The easiest way to bootstrap a self-hosted High Availability Kubernetes cluster. A fully automated HA k3s etcd install with kube-vip, MetalLB, and more. Build. Destroy. Repeat.
https://technotim.live/posts/k3s-etcd-ansible/
Apache License 2.0
2.41k stars 1.05k forks source link

Running in PXE env. #153

Closed Trackhe closed 1 year ago

Trackhe commented 1 year ago

Hey i m found your Project, and i like it much. I m working on a mixed Cluster that is booting over PXE, in the past i figured out that containerd cant working under a PXE/nfs envoirement, my fix was in the past that workaround:

//Fix for running containerd credits on: https://www.redhat.com/sysadmin/rootless-podman-nfs
truncate -s 10g /home/ubuntu/storage.img &&
mkfs.xfs -m reflink=1 /home/ubuntu/storage.img &&
mkdir -p /home/ubuntu/.local/share/containers &&
mount /home/ubuntu/storage.img /home/ubuntu/.local/share/containers &&
sed '$a/home/ubuntu/storage.img /home/ubuntu/.local/share/containers xfs loop 0 0' /etc/fstab &&
apt install containerd -y &&
containerd config default &&
sed -i 's/root = "\/var\/lib\/containerd"/root = "\/home\/ubuntu\/.local\/share\/containers\/containerd"/g' /etc/containerd/config.toml &&
service containerd restart

I would like to implement this in your Playbook but i don't know where i can put this exactly in your task order. Maybe you can add this for nfs boot envoirements.

And as Feature Request would be nice to have the option to install Rook / Cephfs.

Thank you for the Fork and Work.

timothystewart6 commented 1 year ago

Hey! Thank you! This seems pretty specific to your use case and while I would love to merge and build every feature, this might be something you need to maintain in your own branch. Thank you!

timothystewart6 commented 1 year ago

Also, we are leaving storage up to the person who implements their cluster using this tool and would recommend using helm to do it!

Trackhe commented 1 year ago

This problem should exist for every PXE. cluster setup (for every container runtime actually) and you can make that depending on the filesystem type: nfs.

I think that a PXE setup is so nice because of the savings on many sd cards / easy backup ability and scaleability options. This is also why i would say that my usecase is not so specific, but this is only my opinion.

If not then i create a fork. Thank you for your time and work.

timothystewart6 commented 1 year ago

HI and thank you, I do believe that this exists for all PXE users, I am just not sure that the majority of users use PXE :) Thank you for understanding! If you are to keep this in your fork you can easily create a new role or task. Thanks again!