Help improve this page
Want to contribute to this user guide? Scroll to the bottom of this page and select Edit this page on GitHub. Your contributions will help make our user guide better for everyone.
Store an elastic file system with Amazon EFS
Amazon Elastic File System (Amazon EFS)
provides serverless, fully elastic file storage so that you can share file data without
provisioning or managing storage capacity and performance. The Amazon EFS Container Storage
Interface (CSI) driver
Considerations
-
The Amazon EFS CSI driver isn't compatible with Windows-based container images.
-
You can't use dynamic provisioning
for persistent volumes with Fargate nodes, but you can use static provisioning . -
Dynamic provisioning
requires 1.2or later of the driver. You can use static provisioning for persistent volumes using version 1.1of the driver on any supported Amazon EKS cluster version. -
Version
1.3.2or later of this driver supports the Arm64 architecture, including Amazon EC2 Graviton-based instances. -
Version
1.4.2or later of this driver supports using FIPS for mounting file systems. -
Take note of the resource quotas for Amazon EFS. For example, there's a quota of 1000 access points that can be created for each Amazon EFS file system. For more information, see Amazon EFS resource quotas that you cannot change.
-
Starting in version
2.0.0, this driver switched from using stunneltoefs-proxyfor TLS connections. Whenefs-proxyis used, it will open a number of threads equal to one plus the number of cores for the node it's running on.
Prerequisites
-
An existing AWS Identity and Access Management (IAM) OpenID Connect (OIDC) provider for your cluster. To determine whether you already have one, or to create one, see Create an IAM OIDC provider for your cluster.
-
Version
2.12.3or later or version1.27.160or later of the AWS Command Line Interface (AWS CLI) installed and configured on your device or AWS CloudShell. To check your current version, use. Package managers suchaws --version | cut -d / -f2 | cut -d ' ' -f1yum,apt-get, or Homebrew for macOS are often several versions behind the latest version of the AWS CLI. To install the latest version, see Installing, updating, and uninstalling the AWS CLI and Quick configuration with aws configure in the AWS Command Line Interface User Guide. The AWS CLI version that is installed in AWS CloudShell might also be several versions behind the latest version. To update it, see Installing AWS CLI to your home directory in the AWS CloudShell User Guide. -
The
kubectlcommand line tool is installed on your device or AWS CloudShell. The version can be the same as or up to one minor version earlier or later than the Kubernetes version of your cluster. For example, if your cluster version is1.30, you can usekubectlversion1.29,1.30, or1.31with it. To install or upgradekubectl, see Set up kubectl and eksctl.
Step 1: Create an IAM role
The Amazon EFS CSI driver requires IAM permissions to interact with your file system.
Create an IAM role and attach the required AWS managed policy to it. You
can use eksctl, the AWS Management Console, or the AWS CLI.
Note
The specific
steps in this procedure are written for using the driver as an Amazon EKS add-on. For
details on self-managed installations, see Set up driver permission
Step 2: Get the Amazon EFS CSI driver
We recommend that you install the Amazon EFS CSI driver through the Amazon EKS
add-on. To add an Amazon EKS add-on to your cluster, see Creating an Amazon EKS add-on. For more
information about add-ons, see Amazon EKS add-ons. If you're unable to use the Amazon EKS add-on, we encourage you to submit an issue
about why you can't to the Containers roadmap
GitHub repository
Alternatively, if you want a self-managed installation of the Amazon EFS
CSI driver, see Installation
Step 3: Create an Amazon EFS file system
Note
This step isn't needed for AWS Fargate. A Pod running on Fargate automatically mounts an Amazon EFS file system.
To create an Amazon EFS file system, see Create an Amazon EFS file system for Amazon EKS
Step 4: Deploy a sample application
You can deploy a variety of sample apps and modify them as needed. For more
information, see Examples