> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# EFS file system

The in-process volume lives on an EFS file system you create. The volume on it can be auto-provisioned by the chart or pre-provisioned by you:

| | Auto-provisioned (default) | Pre-provisioned |
| - | - | - |
| You create | The file system | The file system, an access point, a PersistentVolume, and a claim |
| You set | `storage.inProcess.efs.fileSystemId` | `storage.inProcess.existingClaim` |
| EFS CSI driver IAM | `AmazonEFSCSIDriverPolicy` on the controller | None |

## Create the file system

The file system needs a mount target in each Availability Zone your nodes run in, with a security group that accepts TCP 2049 from the nodes.

```bash theme={null}
FS_ID=$(aws efs create-file-system --region <region> \
  --encrypted --throughput-mode elastic \
  --tags Key=Name,Value=fineparser \
  --query FileSystemId --output text)

# once per Availability Zone
aws efs create-mount-target --region <region> \
  --file-system-id $FS_ID --subnet-id <subnet-id> --security-groups <security-group-id>
```

Elastic throughput scales with the worker pool.

## Install the EFS CSI driver

For auto-provisioning, the driver's controller needs `AmazonEFSCSIDriverPolicy` to create access points:

```bash theme={null}
eksctl create iamserviceaccount \
  --cluster <cluster> --region <region> \
  --namespace kube-system --name efs-csi-controller-sa \
  --role-name AmazonEKS_EFS_CSI_DriverRole --role-only \
  --attach-policy-arn arn:aws:iam::aws:policy/service-role/AmazonEFSCSIDriverPolicy \
  --approve

aws eks create-addon --region <region> --cluster-name <cluster> \
  --addon-name aws-efs-csi-driver \
  --service-account-role-arn arn:aws:iam::<account>:role/AmazonEKS_EFS_CSI_DriverRole
```

For a pre-provisioned volume, the role is not needed. See [Amazon EFS](https://docs.aws.amazon.com/eks/latest/userguide/efs-csi.html) in the Amazon EKS documentation for other installation methods.

## Auto-provisioned

```yaml fineparser-values.yaml theme={null}
storage:
  inProcess:
    efs:
      fileSystemId: fs-0123456789abcdef0
```

The chart creates a StorageClass, `<release>-in-process`, and a claim from it. The driver creates an access point for the claim, owned by user `65534`. Extra [EFS CSI driver parameters](https://github.com/kubernetes-sigs/aws-efs-csi-driver/blob/master/docs/parameters.md), such as `basePath`, go under `storage.inProcess.storageClass.parameters`.

## Pre-provisioned

**1. Create an access point owned by 65534**

```bash theme={null}
aws efs create-access-point --region <region> --file-system-id $FS_ID \
  --posix-user Uid=65534,Gid=65534 \
  --root-directory 'Path=/fineparser,CreationInfo={OwnerUid=65534,OwnerGid=65534,Permissions=755}' \
  --query AccessPointId --output text
```

Do not mount the file system root directly. It is owned by `root`, and FineParser cannot write to it.

**2. Create the volume and claim**

```yaml fineparser-in-process.yaml theme={null}
apiVersion: v1
kind: PersistentVolume
metadata:
  name: fineparser-in-process
spec:
  capacity:
    storage: 10Gi
  accessModes: [ReadWriteMany]
  persistentVolumeReclaimPolicy: Retain
  storageClassName: ""
  csi:
    driver: efs.csi.aws.com
    volumeHandle: fs-0123456789abcdef0::fsap-0123456789abcdef0
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: fineparser-in-process
  namespace: fineparser
spec:
  accessModes: [ReadWriteMany]
  storageClassName: ""
  volumeName: fineparser-in-process
  resources:
    requests:
      storage: 10Gi
```

**3. Point the chart at the claim**

```yaml fineparser-values.yaml theme={null}
storage:
  inProcess:
    existingClaim: fineparser-in-process
```
