tf2-servers icon indicating copy to clipboard operation
tf2-servers copied to clipboard

Add OverlayFS support to do runtime layering

Open stevefan1999-personal opened this issue 3 months ago • 2 comments

It is something like this: https://www.baeldung.com/linux/overlayfs-usage

For example, we have can have a special folder called tf2-overlay and then it will merge the content into the tf2 folder, so we can cleanly separate custom assets (such as sound, materials, maps and models) into a different folder that is ReadWriteMany shared in Kubernetes.

If native overlayfs support was not detected, we have to fall back to use fuse-overlayfs: https://github.com/containers/fuse-overlayfs.

Of course, another way to do it is to just embed those assets into the container images themselves.

FROM ghcr.io/melkortf/tf2-base:latest
COPY ./models/ tf2/models
COPY ./sounds/ tf2/sounds
...

But it comes with a cost of having to constantly track upstream image new version and I kind of hate to have a cron job for doing this when I can just have a minimal set of image that can quickly onboard a new node and share those assets with Ceph or NFS.

And worse, in containers, only the layers above can be shared, and every time I add my 20GB+ assets into the image, it is effectively duplicated again and causing a lot of disk problem (since I always have to start again with the latest base image).

stevefan1999-personal avatar Mar 08 '24 18:03 stevefan1999-personal