App storage, pvc or hostpath?

GrimmReaperNL

Explorer
Joined
Jan 24, 2022
Messages
58
Hi everybody,

I'm about to reinstall to move from a single ssd to a mirrored ssd pool. Looking at backing up my apps and configs and such.
I've made a backup of the truenas config and I was looking at apps.

When installing apps, is it better to use pvc's or hostpaths?
Or do they have different use cases?
 

MisterE2002

Patron
Joined
Sep 5, 2015
Messages
211
a PVC is a "hidden" storage. You can not easily access (or share) it from the Host. Advantage is that you do not have to worry about file permissions. Disadvantage is that if you delete the container the PVC is also deleted.

A Hostpath is directly on the NAS filesystem. You can handle (backup) and share (disclaimer: the hostpath check box saga) this however you want. The disadvantage is that you have to manage the file permissions/ACL's. The container is usually using a UID. If you use CIFS/SAMBA that is usually also using a UID. You can get quickly a mismatch.

Personally i prefer Hostpath. My Linux laptop is using UID1001 and i am sharing with CIFS/SAMBA. I also created a trueNAS user with the same ID and the containers are also using this UID. Containers can create/download files and myself can create new files via the share. This way i do not get conflicts and also avoid using extra ACL's.

Note: for "official" images the UID is 568. This is not allowed for desktop usage. Therefore i need to change this for each container.
 

GrimmReaperNL

Explorer
Joined
Jan 24, 2022
Messages
58
Okay, so if I (re)install on new media and import my config, will all apps retain their configs?
I'm only changing the boot pool, from a single ssd to a mirrored ssd.
 

MisterE2002

Patron
Joined
Sep 5, 2015
Messages
211
That is a good question. Certainly after a fresh install.
AFAIK the PVC is stored in the "ix-applications" folder.
So, it would technically be able to see it after importing the pool.

You can always experiment in a VM.

root@truenas[~]# zfs list | grep sab
tank/ix-applications/releases/sabnzbd/volumes/pvc-c6524f92-f895-4b9d-8935-21cefe675bad
 

GrimmReaperNL

Explorer
Joined
Jan 24, 2022
Messages
58
I don't/haven't worked with vm other than maybe once in school. What I am doing though is leaving the current installation intact. So I can always go back to that if I need to.

Thanks for the replies.
 

GrimmReaperNL

Explorer
Joined
Jan 24, 2022
Messages
58
Okay, as an FYI. I installed to two mirrored ssd's. Uploaded my saved config and all my apps showed up without issue.
This is on TrueNAS-SCALE-22.12.1
 
Top