An optional NFS server can be provisioned to provide shared storage to the Anthos on bare metal cluster. If you follow the standard Quick Starter guide, then the commands required to install the NFS Container Storage Interface (CSI) driver are provided as part of the Terraform output. If you followed one of All in one install or Manual LB install guides then everything is setup automatically.
- This guide has the same pre-requisites as the quickstart guide.
-
Follow any of the guides (Quick starter, All in one install or Manual LB install) with one additional variable added to the
terraform.tfvars
file.# terraform.tfvars file ... nfs_server = true ...
-
The All in one install and Manual LB install guides will automatically setup everything required for the NFS storage class to be available.
However, for the Quick starter mode installation, you will see some additional steps (in addition to the common ones from the Quick starter), printed out as part of the Terraform output. Run those commands from inside your admin-workstation to install the
NFS Driver
into your cluster.SSH into your admin workstation and ensure that the
KUBECONFIG
environment variable is set to the path of your Anthos on bare metal cluster context file.# example output for the Quick starter installation with 'nfs_server = true' ################################################################################ # Configure the cluster to utilize NFS for PVs with the NFS-CSI driver # ################################################################################ > export KUBECONFIG=bmctl-workspace/cluster1/cluster1-kubeconfig && \ curl -skSL https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/v3.1.0/deploy/install-driver.sh | bash -s v3.1.0 -- && \ kubectl apply -f nfs-csi.yaml ################################################################################
-
Verify the availability of the NFS storage classes
kubectl get storageclass
# expected output should include NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE nfs-csi nfs.csi.k8s.io Delete Immediate false 5m
-
The
nfs-csi
storage class can now be utilized for yourPersistantVolumeClaims
.# example for a DataVolume ... spec: pvc: storageClassName: nfs-csi ...
- Follow the same cleanup steps as the quickstart guide.