Updated on 2024-06-26 GMT+08:00

Configuring SFS Turbo Mount Options

This section describes how to configure SFS Turbo mount options. For SFS Turbo, you can only set mount options in a PV and bind the PV by creating a PVC.

Prerequisites

The CCE Container Storage (Everest) version must be 1.2.8 or later. This add-on identifies the mount options and transfers them to the underlying storage resources. The parameter settings take effect only if the underlying storage resources support the specified options.

Notes and Constraints

  • Mount options cannot be configured for Kata containers.
  • Due to the restrictions of the NFS protocol, if an SFS volume is mounted to a node for multiple times, link-related mounting parameters (such as timeo) take effect only when the SFS volume is mounted for the first time by default. For example, if the same SFS file system is mounted to multiple pods running on a node, the mounting parameter set later does not overwrite the existing parameter value. If you want to configure different mounting parameters in the preceding scenario, additionally configure the nosharecache parameter.

SFS Turbo Mount Options

The Everest add-on in CCE presets the options described in Table 1 for mounting SFS Turbo volumes.

Table 1 SFS Turbo mount options

Parameter

Value

Description

vers

3

File system version. Currently, only NFSv3 is supported. Value: 3

nolock

Blank

Whether to lock files on the server using the NLM protocol. If nolock is selected, the lock is valid for applications on one host. For applications on another host, the lock is invalid.

timeo

600

Waiting time before the NFS client retransmits a request. The unit is 0.1 seconds. Recommended value: 600

hard/soft

Blank

Mount mode.

  • hard: If the NFS request times out, the client keeps resending the request until the request is successful.
  • soft: If the NFS request times out, the client returns an error to the invoking program.

The default value is hard.

sharecache/nosharecache

Blank

How the data cache and attribute cache are shared when one file system is concurrently mounted to different clients. If this parameter is set to sharecache, the caches are shared between the mountings. If this parameter is set to nosharecache, the caches are not shared, and one cache is configured for each client mounting. The default value is sharecache.

NOTE:

The nosharecache setting will affect the performance. The mounting information must be obtained for each mounting, which increases the communication overhead with the NFS server and the memory consumption of the NFS clients. In addition, the nosharecache setting on the NFS clients may lead to inconsistent caches. Determine whether to use nosharecache based on site requirements.

You can set other mount options if needed. For details, see Mounting an NFS File System to ECSs (Linux).

Configuring Mount Options in a PV

You can use the mountOptions field to configure mount options in a PV. The options you can configure in mountOptions are listed in SFS Turbo Mount Options.

  1. Use kubectl to connect to the cluster. For details, see Connecting to a Cluster Using kubectl.
  2. Configure mount options in a PV. Example:

    apiVersion: v1
    kind: PersistentVolume
    metadata:
      annotations:
        pv.kubernetes.io/provisioned-by: everest-csi-provisioner
      name: pv-sfsturbo    # PV name
    spec:
      accessModes:
      - ReadWriteMany      # Access mode. The value must be ReadWriteMany for SFS Turbo.
      capacity:
        storage: 500Gi       # SFS Turbo volume capacity
      csi:
        driver: sfsturbo.csi.everest.io    # Dependent storage driver for the mounting
        fsType: nfs
        volumeHandle: {your_volume_id}   # SFS Turbo volume ID
        volumeAttributes:
          everest.io/share-export-location: {your_location}   # Shared path of the SFS Turbo volume
          everest.io/enterprise-project-id: {your_project_id}  # Project ID of the SFS Turbo volume
          storage.kubernetes.io/csiProvisionerIdentity: everest-csi-provisioner
      persistentVolumeReclaimPolicy: Retain    # Reclaim policy
      storageClassName: csi-sfsturbo           # Storage class name of the SFS Turbo file system
      mountOptions:                            # Mount options
      - vers=3
      - nolock
      - timeo=600
      - hard

  3. After a PV is created, you can create a PVC and bind it to the PV, and then mount the PV to the container in the workload. For details, see Using an Existing SFS Turbo File System Through a Static PV.
  4. Check whether the mount options take effect.

    In this example, the PVC is mounted to the workload that uses the nginx:latest image. You can run the mount -l command to check whether the mount options take effect.
    1. View the pod to which the SFS Turbo volume has been mounted. In this example, the workload name is web-sfsturbo.
      kubectl get pod | grep web-sfsturbo

      Command output:

      web-sfsturbo-***   1/1     Running   0             23m
    2. Run the following command to check the mount options (web-sfsturbo-*** is an example pod):
      kubectl exec -it web-sfsturbo-*** -- mount -l | grep nfs

      If the mounting information in the command output is consistent with the configured mount options, the mount options have been configured.

      <Your mount path> on /data type nfs (rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,nolock,noresvport,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=**.**.**.**,mountvers=3,mountport=20048,mountproto=tcp,local_lock=all,addr=**.**.**.**)