I am installing GitLab CE and planning to use TrueNAS’s NFS as the storage for its repository. Here’s what I’ve done on the TrueNAS side:
- Created a user and group:
- Created a user
gitlaband a groupcode. UID and GID are both3002.
- Set up a dataset:
- Created a dataset named
gitlabwith Unix permissions set to:- User:
gitlab - Group:
code - Both user and group have read, write, and execute permissions, while others have no permissions.
- User:
- Configured NFS sharing:
- Created an NFS share for the dataset and set the mapall user to
gitlaband the mapall group tocodein the advanced options.
On the client side (Ubuntu 22.04), I did the following:
- Mounted the NFS share:
sudo mount 172.20.10.76:/mnt/hpc01/gitlab /mnt/gitlab
- Verified the mount:
The mount command output was:
172.20.10.76:/mnt/hpc01/gitlab on /mnt/gitlab type nfs4 (rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.20.10.16,local_lock=none,addr=172.20.10.76)
- Configured GitLab:
- Ran
sudo gitlab-ctl reconfigure. - This step failed with an error indicating that
no_root_squashwas required.
- Modified NFS settings:
- Manually edited the TrueNAS
/etc/exportsfile to changeall_squashtono_root_squash. - Restarted the NFS server.
- Reconfigured GitLab:
- Ran
sudo gitlab-ctl reconfigureagain, and this time it succeeded.
Issues Encountered
- Permission Changes:
After configuring GitLab, I noticed that the UID and GID of thegitlabdataset on TrueNAS had been changed to997and998, respectively. These values match the UID and GID of thegituser on the client system. I suspect that GitLab’s configuration process executed asudo chmod -R git:gitcommand. - NFS Export Reset:
Whenever the NFS server restarts, the manual change tono_root_squashin the/etc/exportsfile is reset toall_squash. This causes GitLab to stop functioning.
Questions
- How can I properly configure TrueNAS to install and run GitLab with NFS storage?
- How can I make the
no_root_squashsetting persistent on TrueNAS?
