1
0
Fork 0
mirror of https://code.forgejo.org/infrastructure/documentation synced 2024-11-22 11:21:10 +00:00

nfs: define a root so that nfsv4 is used instead of nfsv3

This commit is contained in:
Earl Warren 2024-10-06 13:46:36 +02:00
parent f76d6ea2a9
commit 40513d541a
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -758,8 +758,11 @@ lxc-helpers.sh lxc_install_lxc_inside 10.47.3 fc11
```sh ```sh
sudo apt install nfs-kernel-server nfs-common sudo apt install nfs-kernel-server nfs-common
echo /precious 10.53.101.0/255.255.255.0(rw,no_root_squash,subtree_check) | sudo tee -a /etc/exports cat <<EOF | sudo tee -a /etc/exports
sudo exportfs -a /precious 10.53.101.0/24(rw,sync,fsid=0,no_root_squash,no_subtree_check)
/precious/k8s 10.53.101.0/24(rw,nohide,insecure,no_subtree_check,sync)
EOF
sudo exportfs -av
sudo exportfs -s sudo exportfs -s
``` ```
@ -837,7 +840,7 @@ spec:
targetNamespace: default targetNamespace: default
set: set:
nfs.server: 10.53.101.5 nfs.server: 10.53.101.5
nfs.path: /precious nfs.path: /k8s
storageClass.name: nfs storageClass.name: nfs
$ kubectl apply --server-side=true -f nfs.yml $ kubectl apply --server-side=true -f nfs.yml
$ kubectl get storageclass nfs $ kubectl get storageclass nfs
@ -858,11 +861,11 @@ curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 |
### k8s NFS storage creation ### k8s NFS storage creation
Create the directory to be used, with the expected permissions (assuing `/precious` is the directory exported via NFS). Create the directory to be used, with the expected permissions (assuing `/k8s` is the directory exported via NFS).
```sh ```sh
sudo mkdir /precious/forgejo-data sudo mkdir /precious/k8s/forgejo-data
sudo chmod 1000:1000 /precious/forgejo-data sudo chmod 1000:1000 /precious/k8s/forgejo-data
``` ```
Define the `forgejo-data` pvc. Define the `forgejo-data` pvc.
@ -879,7 +882,7 @@ spec:
storage: 20Gi storage: 20Gi
nfs: nfs:
server: 10.53.101.5 server: 10.53.101.5
path: /precious/forgejo-data path: /k8s/forgejo-data
accessModes: accessModes:
- ReadWriteMany - ReadWriteMany
persistentVolumeReclaimPolicy: Retain persistentVolumeReclaimPolicy: Retain