r/TrueNAS: truenas scale as docker server

r/TrueNAS: truenas scale as docker server
💡
This article archives a conversation, which took place in a subreddit post (original source linked below) and to which I contributed a solution or answer (with the u/MasterofSynapse handle), in a Q&A format.

Original Reddit post: https://www.reddit.com/r/truenas/comments/yk3ycq/truenas_scale_as_docker_server/

Question

Hi all

I'm new the truenas and have a few questions that I hope you guys can help me with.

I would like to build a truenas scale server with these properties:

  1. Can I run multiple docker containers (everything I want is already in truecharts) approx 20 dockers - mostly home automation and network stuff like DNS (adguard-home), Home Assistant etc.
  2. Can I easily rollback a docker / all dockers - should something go wrong or get corrupted

I have a an HP Prodesk 600 G2 to available which I think should be ok:

  • Quadcore i5-6500
  • 32GB RAM (non ECC)
  • 3 x 256GB Samsung SATA drives
  • 2 x boot 64GB SSD (using USB3 -> SATA adaptors)

The workstation has AMT for OOB access and I have this working already. I also have a small APC UPS and a spare PSU / Motherboard for this workstation and it's already passed a 24 hour memtest86 without issue.

My questions are:

  1. Is a 3 disk SSD RAIDZ1 the right approach for storing all of the dockers? or is there an advantage to using a mirror? Do they both support snapshots?
  2. Can I pass through as USB device like a zigbee dongle to a docker?
  3. I've read some posts regarding dockers creating 1000's of snapshots and clogging things up - is this still an issue? Does it affect the ability to rollback a single docker if there is an issue?
  4. If the snapshot issue is a problem would running a VM with docker/docker-compose installed allow me to save the data directly to the fault tolerant datastore so snapshots can be created of the entire VM and the docker data separately.
  5. Are APC UPSs' supported via USB?
  6. Is there a better approach using the hardware I have to hand? I'm new to truenas and very open to any feedback.

Much thanks in advacne

Answer

Generally, if you don't specifically need ZFS for your array, UnRaid would be the better choice for you as your Docker hypervisor.

Scale is still quite new and therefore doesn't have the advanced features for comfortable Docker management.

UnRaid has a 30 day trial, take it for a spin and create some containers to get a feel if it is right for you.

Comment 1 on Answer

Agreed. Just considering its roots, SCALE is storage first, VMs/containers second. As the platform matures, VM and container support will start to be on equal footing with, but it takes a lot of development cycles. As some other folks at iX have put it, when SCALE is all grown up, it will be a really compelling alternative to other hypervisor and hyperconverged solutions, but it's not quite there yet.

If your use case is almost entirely hypervisor focused and you aren't particularly interested in helping the community hammer out the kinks of a new-ish platform, Unraid may be a better choice. Also consider Proxmox; I run it at home and it's a rock-solid hypervisor and totally free.

Comment 2 on Answer

I'm using unRAID already for my storage server and run a bunch of media related dockers - it's great for this and I'm not moving away from it.

BUT, unRAID uses btrfs for cache pools and I've found it to be unreliable, I've already lost two pools on two different unRAID servers due issues with btrfs. I'm actually the point where I just use a single NVME as there's no benefit to the btrfs redundancy if it doesn't work. The dockers that I run on unRAID are non-critical so I'm ok with this, and I just use the built-in backup tool to stop the dockers and create a backup nightly.

I'm hoping that ZFS with all of it's reliability with allow me to keep my dockers running 24/7 with live snapshot backups.

Comment 3 on Answer

This is exactly my setup. TrueNAS Scale as a storage-only server for important data. UnRaid for Plex and all-things Docker.