226 points · by vermaden · 3y ago · 60 comments
If you're just looking for an orchestrator capable of running FreeBSD jails, take a look at Nomad (Disclaimer: I work at HashiCorp, opinions my own, etc.)
There could be a similar kind of mapping on FreeBSD.
How does Nomad handle scaling? I'm thinking of a new project, I'd like to have the equivalent of HPA that easily scales to zero on custom metrics and a cluster autoscaler that can easily add heterogenous nodes as necessary. Even better if it can work with MacOS VMs.
I like the isolation for my own bespoke home network, but does it work well in production set up’s?
* https://www.freshports.org/misc/compat12x/
See further:
* https://www.freshports.org/misc/compat11x/
* https://www.freshports.org/misc/compat10x/
[…]
All in all of all the concerns I'd have about using jails in a production environment, dealing with different major versions is not on that list.
It had everything I needed to start manually setting up jails to my liking.
I eventually had to get some additional help online but you come a long, long, long way with that book in your hand.
This jail allows me to lock things down to minimal access to other services I need remotely, such as an SSH tunnel to Home Assistant.
I run my FreeBSD server mainly for ZFS. Adding a jail for remote access adds to the usefulness that hardware.
Potentially a non-vnet jail with the ipv4/ipv6 options set may also be an option. I used to use jails with those settings to squeeze multiple environments into a single host at Yahoo.
Greetings! Miss the ole days at the ‘Hoo when we were all FBSD based!
ssh { exec.start = "/bin/sh /etc/rc"; exec.stop = "/bin/sh /etc/rc.shutdown"; exec.clean; mount.devfs; path = "/var/jail/ssh"; host.hostname = "ssh"; vnet; vnet.interface += "em0"; }
It's IPv6 only, so this is key in rc.conf: rtsold_enable="YES"
OpenBSD PF based router does the rest. IPv6 simplifies things here.
PF on FreeBSD isn't the most ideal, sure, but I can limit local access on inet6.
For SSH tunnel, it's straight forward.
It's awesome that you can do everything you would want with a jail with only 3 config files: rc.conf (for networking and start-up), pf.conf (for firewalling/routing), and jail.conf (for specifying jail params like mount points, network if setup, etc.).
Super clean, super easy.
- bastille https://bastillebsd.org
- pot https://potluck.honeyguide.net
bastille is great for personal and small setups, pot is aimed at larger scale and meant to be used along with hashicorp nomad+consul
And, you'd be missing out on features like VNET that came later (FreeBSD 8), unless Apple reintegrated with upstream, which is pretty rare for them. (They did update the FreeBSD userland, once)
It does seem like a feature worth porting, though.
Docker does not have this limitation. You can run a container that is based on a newer version of Linux than the host.
FreeBSD is developed as a whole unit. It makes it easier to reason that a 13.2 userland doesn't run on a 12.4 kernel.
FWIW, it would take quite a long time for glibc itself to start requiring Linux 6.3 on its current targets. Since glibc 2.24 (Aug. 2016), the minimum supported kernel has been at most Linux 3.2 (Jan. 2012), on every target that has existed that long. And that's the smallest that the gap between the glibc and Linux releases has ever gotten (except for new targets). Extrapolating, we'd have to wait for glibc 2.47 (Feb. 2028) to require Linux 6.3 (Apr. 2023), if that gap were to be repeated, something which I don't find particularly likely.
That is to say, with the exception of new targets, you'll rarely see a userland that absolutely requires the latest Linux kernel, even possibly if it suggests that kernel for the best support.
For example: Per its own README, systemd requires Linux 3.15 at absolute minimum, recommends Linux 4.15 for baseline functionality to at least work, and specifies Linux 5.7 for full BPF functionality.
(Well. Technically it's kind of true. You can run a container based on a newer kernel, it'll just crash when you use any new features)