jails AppJail with multiple zpools?

Hi all and DtxdF in particular,

I am using AppJail and fairly happy with it so far, it however its workflow is mapped to a single zfs zpool and I have multiple zpools in this box of mine. I am keen to spread out the workloads across all my zpools.

will have a dig through the codebase to see what sort of changes could be required to support multiple zpools, but wanted to drop the question here to see if anyone has a working workflow for appjail and multiple pools

thanks a million
- azul

​

 
Hi Azulinho

This is not supported by AppJail, but this does not mean that you cannot separate your data and put it in other datasets of other zpools. For example, suppose I want to deploy two services, filebrowser and flatnotes, but I want to store the flatnotes data on my slow HDD and the filebrowser data on my fast SSD.

filebrowser:
.env
:

Code:
DIRECTOR_PROJECT=filebrowser
TAG=14.1

appjail-director.yml:

Code:
options:
  - virtualnet: ':<random> default'
  - nat:

services:
  filebrowser:
    name: filebrowser
    makejail: ./Makejail
    volumes:
      - db: filebrowser-db
      - log: filebrowser-log
      - www: filebrowser-www
    arguments:
      - filebrowser_tag: !ENV '${TAG}'
    start-environment:
      - FB_NOAUTH: 1

default_volume_type: '<volumefs>'

volumes:
  db:
    device: /var/appjail-volumes/filebrowser/db
  log:
    device: /var/appjail-volumes/filebrowser/log
  www:
    device: /var/appjail-volumes/filebrowser/www

Makejail:

Code:
INCLUDE gh+DtxdF/efficient-makejail
INCLUDE gh+AppJail-makejails/filebrowser

flatnotes:

.env:

Code:
DIRECTOR_PROJECT=flatnotes
TAG=14.1

appjail-director.yml:

Code:
options:
  - virtualnet: ':<random> default'
  - nat:

services:
  flatnotes:
    name: flatnotes
    makejail: ./Makejail
    start-environment:
      - FLATNOTES_AUTH_TYPE: 'none'
    volumes:
      - flatnotes-data: flatnotes-data
    arguments:
      - flatnotes_tag: !ENV '${TAG}'

default_volume_type: '<volumefs>'

volumes:
  flatnotes-data:
    device: /var/appjail-volumes/flatnotes/data

Makejail:

Code:
INCLUDE gh+AppJail-makejails/flatnotes
INCLUDE gh+DtxdF/efficient-makejail

Suppose /var/appjail-volumes is a dataset located on my slow HDD and /super-fast is located on my fast SSD, I just have to change all device items in the volumes section of my appjail-director.yml file. For applications inside the jails it makes no difference if I choose HDD or SSD.

This, of course, uses Director, but you can accomplish this with a few commands with AppJail [1], although I recommend that you use something like Director or a Makejail to automate this and know for the future what instructions you used.

[1] https://appjail.readthedocs.io/en/latest/fs-mgmt/
 
Back
Top