Creating an NFS PersistentVolume

Create a Network file system (NFS) PersistentVolume.

Prerequisites

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:

  1. From the navigation menu, click Platform > Storage.
  2. Click Create PersistentVolume.
  3. 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.
  4. Click Create.

Creating an NFS PersistentVolume by using the "Create resource" window

  1. From the dashboard, click Create resource.
  2. 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 Opens in a new tab.
    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>
    
  3. 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.