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
gitlab
and a groupcode
. UID and GID are both3002
.
- Set up a dataset:
- Created a dataset named
gitlab
with 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
gitlab
and the mapall group tocode
in 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_squash
was required.
- Modified NFS settings:
- Manually edited the TrueNAS
/etc/exports
file to changeall_squash
tono_root_squash
. - Restarted the NFS server.
- Reconfigured GitLab:
- Ran
sudo gitlab-ctl reconfigure
again, and this time it succeeded.
Issues Encountered
- Permission Changes:
After configuring GitLab, I noticed that the UID and GID of thegitlab
dataset on TrueNAS had been changed to997
and998
, respectively. These values match the UID and GID of thegit
user on the client system. I suspect that GitLab’s configuration process executed asudo chmod -R git:git
command. - NFS Export Reset:
Whenever the NFS server restarts, the manual change tono_root_squash
in the/etc/exports
file 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_squash
setting persistent on TrueNAS?