This script creates a Container VM on Google Compute Engine running a NFS V4 server exposed on Port 2049 with the /exports directory mounted to a persistent disk. This means:
- If the NFS VM Crashes, the persistent disk will still hold the NFS Files
- The persistent disk can be snapshotted to backup NFS Files
To run:
- Install the Google Cloud SDK and authenticate to your project: https://cloud.google.com/sdk/
- Create a Persistent Disk named "nfs-pd"
- Download the files create.sh, nfs-vm-config.yaml, and privileged.sh to the same folder
- Run the create.sh script
To connect:
Use a NFS V4 client on other Compute Engine instances to connect to your NFS VM. You can use the NFS VM name ("nfs" in this script) as the hostame in order to resolve to the NFS VM's internal IP Address.
To debug:
- SSH to the container vm
- Execute "sudo docker ps". You should see the nfs container running. If you don't, check out the logs in /var/log/kubelet.log