Preparing the data Storage
About this task
The lnk-server, lnk-rest, and lnk-executor deployments share the same data storage.
Each of these deployments mounts the shared volume at the /data path, so that they all access the same content.
Complete the following steps to create the EFS access point, Persistent Volume (PV), and Persistent Volume Claim (PVC).
Procedure
-
Create the EFS access point for the data volume.
EFS_AP_DATA=$(aws efs create-access-point \ --file-system-id $EFS_FS_ID \ --posix-user Uid=1000,Gid=1000 \ --root-directory "Path=/data,CreationInfo={OwnerUid=1000,OwnerGid=1000,Permissions=777}" \ --region $AWS_REGION \ --query 'AccessPointId' \ --output text) -
Create the Persistent Volume (PV).
echo " apiVersion: v1 kind: PersistentVolume metadata: name: link-data-pv spec: capacity: storage: 5Gi volumeMode: Filesystem accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain storageClassName: efs-sc csi: driver: efs.csi.aws.com volumeHandle: $EFS_FS_ID::$EFS_AP_DATA " | kubectl apply -f - -
Create the Persistent Volume Claim (PVC) and bind it to
the PV.
echo " apiVersion: v1 kind: PersistentVolumeClaim metadata: name: link-data-pvc spec: accessModes: - ReadWriteMany storageClassName: efs-sc volumeName: link-data-pv resources: requests: storage: 5Gi " | kubectl apply -f - -
Verify that the PVC was created and successfully bound to the PV.
kubectl get pvc link-data-pvcExample output:NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE link-data-pvc Bound link-data-pv 5Gi RWX efs-sc <unset> 23s