TrueNAS Scale required Apps for Truecharts

If you plan to install any Truecharts, there are several recommended prerequisites:

  1. Ensure you have configured the required pool and installed the catalogs.
  2. Install OpenEBS, (which is necessary for Dragonfish).
  3. Install Heavyscript and schedule it to run as a Cron Job.
  4. Install Prometheus-operator.
  5. Install Cloudnative-PG Operator.

While the above are not mandatory for all applications, they should be installed first if needed. Therefore, it makes sense to set them up before installing any other apps

Install OpenEBS

If you're using the Dragonfish (24.04) version of TrueNAS SCALE, you'll need to install OpenEBS to provide PVC storage. While I would recommend using host path storage, it is not supported by TrueCharts.

First, you must create a dataset specifically for OpenEBS, which should be different from the iX-applications dataset. If you've followed my setup, you can utilize the 'appdata' dataset. In TrueNAS SCALE, navigate to 'Datasets' and select the 'appdata' dataset. Then click Add Dataset.

Screenshot of the detailed settings for a file system dataset named 'appdata'.

Name the dataset 'openebs' and click 'Save'. Then, click 'Edit' next to 'Permissions'.

User interface for adding a new dataset within a storage management system.
Permissions settings in a file system management interface.

In the resulting form, change both "User" and "Group" to "apps", ensuring that "Apply User" and "Apply Group" are selected. Also, grant write permissions to the Group. Finally, click "In the resulting form, change both "User" and "Group" to "apps", ensuring that "Apply User" and "Apply Group" are selected. Also, grant write permissions to the Group. Finally, click "Save".".

Configuration of Unix permissions for a dataset within a storage system interface.

Click on "Apps," followed by "Discover apps," and enter "OpenEBS" in the search bar. Then, click on the app and select "Install."

Screenshot of an application discovery interface with search results for "OpenEBS".
Screenshot of the OpenEBS installation page with resource availability and application details.

The only setting you need to adjust is the Storage and Permissions Pool/Dataset, which should be set to the path of the dataset you created earlier. In this instance, it is 'appdata/openebs'. Be sure to check for typos, as there is no verification process to confirm that the path exists. If there is a typo in the path, you will need to delete the app and reinstall it. After verifying the settings, click "Install." If all goes according to plan, you should see the app deploying and subsequently running.

A snapshot of the application status dashboard indicating the OpenEBS application is running smoothly.

Install Heavyscript

HeavyScript provides numerous features that enhance the user experience and maintenance of applications on SCALE, developed by heavybullets8.

This document outlines the non-privileged method for installing the script. Currently, there is a known issue with installation on Dragonfish.

Process for TrueNAS Scale Cobia

Log in to a command prompt as admin and run the following command.

curl -s https://raw.githubusercontent.com/Heavybullets8/heavy_script/main/functions/deploy.sh | bash && source "$HOME/.bashrc" 2>/dev/null && source "$HOME/.zshrc" 2>/dev/null

As you are running the script with minimum privaleges you will get a warning. If everything proceeds smoothly, you should see:

A screenshot of a PuTTY terminal window showing an installation process of HeavyScript on a TrueNAS system.

Note the error and the example cron job command.

The error is caused by running the script without root privileges. To create the necessary link that allows the script to be run using the command "heavyscript", execute the following command:

(If necessary, modify the command to match the example in the above screenshot.)

sudo bash /home/admin/heavy_script/heavy_script.sh

You should then briefly see:

Screenshot of a terminal session where an administrator attempts to execute a script that creates a symbolic link for heavyscript, encounters a broken symlink issue, and generates a config.ini file.

This will be followed by the heavyscript menu.

A black PuTTY terminal window displaying a menu from HeavyScript v2.9.3 with options including Help, Application Options, Backup Options, HeavyScript Options, and Exit.

This completes the instalation of heavyscript. You should now be able to run the script with the comand heavyscript. If you need heavyscript to execute commands you will have to use the sudo comand.

sudo heavyscript

Process for TrueNAS Scale Dragonfish

As of the Dragonfish Release Candidate, the installation process for heavyscript has changed slightly.

Execute the same command as above:

curl -s https://raw.githubusercontent.com/Heavybullets8/heavy_script/main/functions/deploy.sh | bash && source "$HOME/.bashrc" 2>/dev/null && source "$HOME/.zshrc" 2>/dev/null

The output will be:

Terminal output displaying the installation process of HeavyScript on a TrueNAS system.

The script cannot write to /usr/local/bin, so there is an error. Until there is an update to heavyscript, the easiest way to run the script is to use the full path.

(If necessary, change the command to reflect the example in the above screen capture.)

Copy and execute this command:

sudo bash /home/admin/heavy_script/heavy_script.sh

The first time you run this you will get an error:

A terminal session in PuTTY showing a script execution for installing HeavyScript, with warnings about broken symlinks and file system permissions.

From then on the script will run without error.

Setting HeavyScript to run every day with Cron Job

You can configure HeavyScript to run daily and perform a variety of tasks. Heavybullets8 recommends the following:

sudo bash /home/admin/heavy_script/heavy_script.sh update --backup 14 --concurrent 10 --prune --rollback --sync --self-update

This command run as sudo will:

  • upate - Update the aapplication
  • --backup 14 - take a backup and keep 14 hackups
  • --concurrent 10 - update 10 apps concurently
  • --prune - prune unused images after the backup
  • --rollback - rollback to the previous version if the update fails
  • --sync - sync the catalog prior to updating applications
  • --self-update - Update HeavyScript itself prior to updating

Run the above command to ensure it executes correctly. The command may take some time to complete, but you will end up back at the command prompt.

A terminal window in PuTTY showing an update status with two applications listed, 'openebs' with its latest version, and 'cloudflaredns-ryeroxley' showing both the updated and active versions.

To automate tasks, you need to set up a cron job. Here's how:

  1. Navigate to System Settings > Advanced.
  2. Select 'Cron Jobs' (accept the warning if prompted).
  3. If you have existing cron jobs, click 'Add' to create a new one.

In the form that appears:

  • Assign a name to the cron job.
  • Enter the command you previously tested, omitting 'sudo' but including the 'bash' prefix and the full command path to ensure it executes correctly.
  • Choose 'Run as user' root since additional permissions are often necessary for proper execution.
  • Under 'Schedule', set the frequency and time for the script to run, such as daily at 12:00 AM.
  • If you want to receive email notifications about the cron job’s output and errors, leave 'Hide Standard Output/Error' unchecked.
bash /home/admin/heavy_script/heavy_script.sh update --backup 14 --concurrent 10 --prune --rollback --sync --self-update
A graphical interface for scheduling a cron job with a description 'Auto Update Applications', and a command to execute a script as the root user, scheduled to run daily at midnight.

The issue with executing this cron job arises from attempting to update heavyscript as the root user when the admin user originally installed it. Git disapproves of this approach, leading to the error:

fatal: detected dubious ownership in repository at '/home/admin/heavy_script'

To allow the script to run successfully, you need an entry in /root/.gitconfig to allow root to update heavyscript. Unter the following command:

sudo nano /root/.gitconfig

Paste the following:

[safe]
        directory = /home/admin/heavy_script

Press "Ctrl + X" next, and when prompted, save the file to /root/.gitconfig.

To test the settings, first ensure that the root user has an email address configured. Then, in the TrueNAS Scale GUI, navigate to System Settings > Advanced and open the Cron Jobs panel. Click the dropdown to expand the relevant Cron Job and select "Run Now." Afterward, click "Continue" and then "Close."

A user interface for Cron Jobs featuring a list with columns for Users, Command, Description, and Schedule. There's one entry for the root user with a command starting with 'bash /home/...', described as 'Auto Update Applications', scheduled for midnight every day.
An expanded view of a Cron Job configuration for the root user with additional details including the next run time, output settings, and options to Run Now, Edit, or Delete the job.

If all goes well you should recieve an email with the line:

"HeavyScript is already the latest version:"

Installing the Prometheus Operator from TrueCharts

The TrueCharts Prometheus Operator does not require a PVC setting, so setting up a dataset is unnecessary.

In the TrueNAS SCALE GUI, navigate to Apps > Discover Apps and search for "Prometheus-operator." (Note: The search function can sometimes be unreliable. If needed, try searching for "operator" instead.) Click on the app, and then click "Install."

A software card for Prometheus-Operator version 6.10.13 from the TrueCharts catalog, featuring the Prometheus logo integrated with the Kubernetes wheel symbol, indicating its role in monitoring Kubernetes systems.

There are no options to update, so just click "Install."

Screenshot of the 'Install Prometheus-operator' interface on TrueNAS SCALE, featuring a dark mode design, with fields for application name and version, alongside a 'Global Settings' section with a 'Stop All' option and additional help links to TrueCharts documentation.

If the operation completes successfully, the app will be displayed as running.

A dashboard snippet showing the 'prometheus-operator' app by TrueCharts as 'Running' with 0% CPU usage, 19.2 MiB memory usage, network activity at 93.83 kb/s download and 33.07 kb/s upload, labeled 'Up to date'.

Installing the Cloudnative-Pg from TrueCharts

The TrueCharts Cloudnative-Pg Operator does not require a PVC setting, so setting up a dataset is unnecessary.

In the TrueNAS SCALE GUI, navigate to Apps > Discover Apps and search for "Cloudnative-Pg." Click on the app, and then click "Install."

The TrueCharts logo precedes text detailing 'Cloudnative-Pg', version 6.9.13, described as a clustered PostgreSQL database operator, all against a dark background.

There are no options to update, so just click "Install."

If the operation completes successfully, the app will be displayed as running.

Dashboard status display showing 'cloudnative-pg' application from Truecharts running, with usage statistics indicating 18.89 MiB of memory and network speeds of 860.66 kb/s download and 92.02 kb/s upload, denoted as up to date.

Installing the Cloudnative-Pg from TrueCharts

The TrueCharts Cloudnative-Pg Operator does not require a PVC setting, so setting up a dataset is unnecessary.

In the TrueNAS SCALE GUI, navigate to Apps > Discover Apps and search for "Cloudnative-Pg." Click on the app, and then click "Install."

The TrueCharts logo precedes text detailing 'Cloudnative-Pg', version 6.9.13, described as a clustered PostgreSQL database operator, all against a dark background.

There are no options to update, so just click "Install."

Screenshot of the 'Install Cloudnative-pg' interface in TrueNAS SCALE, featuring fields for application name and version selection, with additional links to documentation for global settings, timezone, and pod options.

If the operation completes successfully, the app will be displayed as running.

Dashboard status display showing 'cloudnative-pg' application from Truecharts running, with usage statistics indicating 18.89 MiB of memory and network speeds of 860.66 kb/s download and 92.02 kb/s upload, denoted as up to date.

That completes all the prerequisites required for Truecharts.