Skip to content

AwsNfsVolume Custom Resource ​

The awsnfsvolume.cloud-resources.kyma-project.io custom resource (CR) describes the AWS EFS instance that can be used as a ReadWriteMany (RWX) volume in the cluster. Once the Amazon Elastic File System (AWS EFS) instance is provisioned in the underlying cloud provider subscription, also the corresponding PersistentVolume (PV) and PersistentVolumeClaim (PVC) are created in RWX mode, so they can be used from multiple cluster workloads. To use it as a volume in the cluster workload, specify the workload volume of the persistentVolumeClaim type. A created AwsNfsVolume can be deleted only where there are no workloads that are using it, and when PV and PVC are unbound.

The AwsNfsVolume requires an IP address in each zone of the cluster. Those IP addresses are allocated from the IpRange. If the IpRange is not specified in the AwsNfsVolume then the default IpRange is used. If a default IpRange does not exist, it is automatically created. Manually create a non-default IpRange with specified CIDR and use it only in advanced cases of network topology when you want to be in control of the network segments to avoid range conflicts with other networks.

Though AWS EFS is elastic in its capacity, you must specify the capacity field on the resource since it's a required field on the PV and PVC. The recommended value for capacity is the maximum capacity that you would need.

You can specify the PerformanceMode and Throughput AWS EFS configuration options, but they are optional and default to generalPurpose and bursting.

By default, the created PV and PVC have the same name as the AwsNfsVolume resource, but you can optionally specify their names, labels and annotations if needed. If PV or PVC already exists with a name equal to the one being created, the provisioned AWS EFS remains and the AwsNfsVolume is put into the Errorstate.

Specification ​

This table lists the parameters of the given resource together with their descriptions:

Spec:

ParameterTypeDescription
ipRangeobjectOptional IpRange reference. If omitted, default IpRange will be used, if default IpRange does not exist, it will be created
ipRange.namestringName of the existing IpRange to use.
capacityquantityMaximum capacity of the volume. For example: 1300, 800M, 900Mi, 10G, 100Gi, 1T, 10Ti... To learn more, read about K8S quantity
performanceModestringThe EFS PerformanceMode configuration option. One of generalPurpose, maxIO. Defaults to generalPurpose.
throughputstringThe EFS Throughput configuration option. One of bursting, elastic. Defaults to bursting.
volumeobjectThe PersistentVolume options. Optional.
volume.namestringThe PersistentVolume name. Optional. Defaults to the name of the AwsNfsVolume resource.
volume.labelsmap[string]stringThe PersistentVolume labels. Optional. Defaults to nil.
volume.annotationsmap[string]stringThe PersistentVolume annotations. Optional. Defaults to nil.
volumeClaimobjectThe PersistentVolumeClaim options. Optional.
volumeClaim.namestringThe PersistentVolumeClaim name. Optional. Defaults to the name of the AwsNfsVolume resource.
volumeClaim.labelsmap[string]stringThe PersistentVolumeClaim labels. Optional. Defaults to nil.
volumeClaim.annotationsmap[string]stringThe PersistentVolumeClaim annotations. Optional. Defaults to nil.

Status:

ParameterTypeDescription
state (required)stringSignifies the current state of CustomObject. Its value can be either Ready, Processing, Error, Warning, or Deleting.
capacityquantityProvides the combined size of all data on the underlying EFS. This is a dynamic value that changes as volume is used and, therefore, gets updated frequently to reflect the changes.
conditions[]objectRepresents the current state of the CR's conditions.
conditions.lastTransitionTimestringDefines the date of the last condition status change.
conditions.messagestringProvides more details about the condition status change.
conditions.reasonstringDefines the reason for the condition status change.
conditions.status (required)stringRepresents the status of the condition. The value is either True, False, or Unknown.
conditions.typestringProvides a short description of the condition.

Sample Custom Resource ​

See an exemplary AwsNfsVolume custom resource:

yaml
apiVersion: cloud-resources.kyma-project.io/v1beta1
kind: AwsNfsVolume
metadata:
  name: my-vol
spec:
  capacity: 10T
---
apiVersion: v1
kind: Pod
metadata:
  name: workload
spec:
  volumes:
    - name: data
      persistentVolumeClaim:
        claimName: my-vol
  containers:
    - name: workload
      image: nginx
      volumeMounts:
        - mountPath: "/mnt/data1"
          name: data