Configuration

EFS Volume Mount with Access Point

This guide outlines the steps to mount an Amazon Elastic File System (EFS) with access points to an Amazon EKS cluster on AWS. Following these steps, you can seamlessly integrate EFS storage into your EKS applications, allowing for shared access across multiple pods.


Note: If the EFS is already created in AWS, please skip the Create an EFS File System section and start from the Create Access Points section.

Create an EFS File System

  1. Click on "Create file system" in the Amazon EFS service in AWS.
  2. Follow the prompts to create the EFS by selecting the appropriate VPC.
    Now EFS is created.

Create Access points

  1. Once the EFS is created, select the file system and click "Access points”.
  2. Click on "Create access point”.
  3. Provide a name for the Access point and specify the root directory path as "/any-name".
  4. Under "POSIX user," set:
    USERID: 0
    Group ID: 0
    Secondary GroupID: 0
  5. Set permissions for the root directory:
    OWNER USER ID: 777
    OWNER GROUP ID: 777
    Access point: 777
    Follow the same configuration as shown in the screenshot below.
  6. Repeat the process to create access points for the following directories:
    1.  third-party-jars  (csp-lib.jar, lineage.jar, required jars)
    2. certs
    3. files
    4. es


    Now Access points are created.

Update Helm Charts

  1. Navigate to the Helm charts for the necessary changes.
  2. No additional action is required for the storage class if it's already created in the templates.
  3. For each directory (jars, certs, files, es), update the PersistentVolume and PersistentVolumeClaim YAML files with the appropriate file system ID and access point ID obtained from the EFS.
  4. JARS
  5. PersistentVolume
    Replace <fileSystem-id> & <AccessPointID> with the actual EFS ID and access point ID of "jars" from EFS.

jars_pv.yaml

apiVersion: v1

kind: PersistentVolume

metadata:

  name: efs-pv-jars

spec:

  capacity:

    storage: 2Gi

  volumeMode: Filesystem

  accessModes:

    - ReadWriteMany

  persistentVolumeReclaimPolicy: Retain

  storageClassName: efs-sc

  csi:

    driver: efs.csi.aws.com

    volumeHandle: <fs-filesystem_ID>::<AccessPointID>

  • PersistentVolumeClaim

jars_pvc.yaml

apiVersion: v1

kind: PersistentVolumeClaim

metadata:

  name: efs-claim-jars

spec:

  accessModes:

    - ReadWriteMany

  storageClassName: efs-sc

  resources:

    requests:

      storage: 2Gi

  • Certs
  • PersistentVolume
    Replace <fileSystem-id> & <AccessPointID> with the actual file system ID and access point ID of "certs" from EFS.

certs_pv.yaml

apiVersion: v1

kind: PersistentVolume

metadata:

  name: efs-pv-certs

spec:

  capacity:

    storage: 1Gi

  volumeMode: Filesystem

  accessModes:

    - ReadWriteMany

  persistentVolumeReclaimPolicy: Retain

  storageClassName: efs-sc

  csi:

    driver: efs.csi.aws.com

    volumeHandle: <fs-filesystem_ID>::<AccessPointID>

  • PersistentVolumeClaim

certs_pvc.yaml

apiVersion: v1

kind: PersistentVolumeClaim

metadata:

  name: efs-claim-certs

spec:

  accessModes:

    - ReadWriteMany

  storageClassName: efs-sc

  resources:

    requests:

      storage: 1Gi

  • Files
  • PersistentVolume
    Replace <fileSystem-id> & <AccessPointID> with the actual file system ID and access point ID of "files" from EFS.

files_pv.yaml

apiVersion: v1

kind: PersistentVolume

metadata:

  name: efs-pv-files

spec:

  capacity:

    storage: 7Gi

  volumeMode: Filesystem

  accessModes:

    - ReadWriteMany

  persistentVolumeReclaimPolicy: Retain

  storageClassName: efs-sc

  csi:

    driver: efs.csi.aws.com

    volumeHandle: <fs-filesystem_ID>::<AccessPointID>

  • PersistentVolumeClaim

files_pvc.yaml

apiVersion: v1

kind: PersistentVolumeClaim

metadata:

  name: efs-claim-files

spec:

  accessModes:

    - ReadWriteMany

  storageClassName: efs-sc

  resources:

    requests:

      storage: 7Gi


Attach the previously created PersistentVolumeClaim as a volume to the desired ui & job pods.

yaml

volumes:

  - name: efs-volume-jars

    persistentVolumeClaim:

      claimName: efs-claim-jars

  - name: efs-volume-certs

    persistentVolumeClaim:

      claimName: efs-claim-certs

  - name: efs-volume-files

    persistentVolumeClaim:

      claimName: efs-claim-files

volumeMounts:

  - name: efs-volume-jars

    mountPath: /home/ovaledge/third_party_jars

  - name: efs-volume-certs

    mountPath: /home/ovaledge/certificates

  - name: efs-volume-files

    mountPath: /home/ovaledgefiles


Please find below a screenshot for your reference


Install the updated Helm Chart

          helm install ovaledge ovaledge

This will deploy your application with the updated configurations, including the EFS volume mounts.


Copyright © 2024, OvalEdge LLC, Peachtree Corners, GA USA