FreeBSD Celebrates 25th Anniversary
I’ve been using FreeBSD in production on AWS for a few years now and it’s been great, thanks to ZFS, jails and pf.<p>There are lots of different ways to configure jails, which unfortunately means there are lots of places to get stuck.<p>I typically deploy to x1.* instances, which have NVMe drives. I create a zpool of all the NVMe drives, and then mount a zfs filesystem on the zpool at /mnt/jails.  I run all my services in jails. Each jail gets its own IP address on the host, and services are made available to the outside world using pf rdr rules. Services in jails are allowed to access the outside network using pf nat rules. pf makes it easy to monitor and restrict network activity for each service.<p>Once you’ve configured a jail, you can snapshot it with zfs, compress the snapshot, archive it and rsync it to other FreeBSD hosts. Once copied to other hosts, starting the jail simply requires registering it in /etc/jail.conf and running `service jail start $JailName`.<p>I’ve started documenting this and have been thinking hard about how to provide a more generic container interface on top of this implementation. If you’re interested in the shell scripts,
I’ve started posting them here:<p><a href="https://github.com/cieplak/jz" rel="nofollow">https://github.com/cieplak/jz</a>