Creating an NFS PersistentVolume
Create a Network file system (NFS) PersistentVolume.
Prerequisites
- An NFS server must be set up and available. For more information about the supported NFS versions in IBM® Cloud Private, see Supported file systems and storage.
-
NFS client package must be installed on all nodes in your IBM Cloud Private cluster.
-
On Ubuntu, run the following commands:
sudo apt-get update
sudo apt-get install nfs-common
-
On Red Hat Enterprise Linux (RHEL), run the following command:
yum install nfs-utils
-
Creating an NFS PersistentVolume by using the Create PersistentVolume dialog box
You can create an NFS PersistentVolume in your cluster, then containers in your application can use it for data persistence.
To view a list of PersistentVolume, from the navigation menu, click Platform > Storage.
Required user type or access level: Cluster administrator
Creating an NFS PersistentVolume by using the Create PersistentVolume window
To set up an NFS PersistentVolume:
- From the navigation menu, click Platform > Storage.
- Click Create PersistentVolume.
-
Enter the PersistentVolume details.
To create an NFS PersistentVolume, the following parameters are required:
General tab
- Name - provide a name for the PersistentVolume.
- Capacity
- Access mode
- Reclaim policy
-
Type of storage - select NFS
Parameters tab
- Parameters for storage. Parameters are supplied as key and value pairs. For NFS, you must specify:
- A server
- Key: - server
- Value: - the NFS server host name or IP.
- A path
- Key: - path
- Value: - the location of the directory on your NFS server that is mounted as a shared directory.
- A server
-
Click Create.
Creating an NFS PersistentVolume by using the "Create resource" window
- From the dashboard, click Create resource.
-
Copy and paste a YAML or JSON file into the "Create resource" dialog box. For more information about creating a quota by using a YAML file, see https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistent-volumes .
A simple YAML file might look like this text:apiVersion: v1 kind: PersistentVolume metadata: name: nfsvol01 spec: capacity: storage: 40Gi accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Recycle nfs: path: <insert/path/to/share> server: <insert_nfs_server_ip_or_name>
-
Click Create.
After the deployment completes, a new NFS PersistentVolume is displayed in the PersistentVolume list. Review the status of the PersistentVolume. The PersistentVolume must have a status of Available
.