Mount S3 with Pods in EKS (Static Provisioning)

Krupakar Reddy
2 min readDec 25, 2023

In the domain of cloud-native applications and container orchestration, managing storage for workloads is a critical aspect. AWS S3 CSI Driver comes into play to simplify how containerized applications interact with Amazon S3, the scalable object storage service offered by AWS.

The AWS S3 CSI Driver, in particular, focuses on integrating Kubernetes clusters with Amazon S3. It acts as a bridge, enabling Kubernetes applications to treat S3 buckets as if they were mounted file systems. This abstraction simplifies the storage interaction for applications, rendering the interaction more familiar, similar to traditional file system operations.

Features and Functions:

  • File System Interface: The AWS S3 CSI Driver presents S3 buckets as volumes accessible by containers within Kubernetes.
  • High Throughput: The driver supports both ReadWriteMany and ReadOnlyMany access modes for reading and writing operations.
  • Compatibility: While designed to smoothly work with EKS, S3 CSI Driver can also be integrated into self-managed Kubernetes clusters, providing flexibility across different deployment scenarios.
  • Static provisioning: Mount an existing S3 bucket with persistant volume for your pod.

Considerations:

  • Compatibility and Limitations: It’s important to note that the driver have limitations, such as not being compatible with :
    - windows-based container images
    - AWS Fargate is not supported
    - Dynamic provisioning for creating new buckets is not available.

Installation:

Simply try S3 Driver Installation with my terraform module (add-on resource):

provider "aws" {
region = "ap-south-1"
}

module "s3-csi-driver" {
source = "krupakar0307/s3-csi-driver/aws"
version = "0.0.2"
aws_region = "region" # provide your region
aws_profile = "profile_name" # provide your environment profile name
bucket_name = "bucket_name" # provide your bucket_name
iam_role_name = "role_name" # provide name for IAM role
eks_cluster = "cluster_name" # provide cluster name
}

(OR)

To setup S3 Driver manually: https://docs.aws.amazon.com/eks/latest/userguide/s3-csi.html#s3-create-iam-policy

After setting up the S3 driver, mount a pre-existing bucket with your pods by following the reference:

https://github.com/awslabs/mountpoint-s3-csi-driver/blob/main/examples/kubernetes/static_provisioning/static_provisioning.yaml

To conclude, the AWS S3 CSI Driver simplifies the integration of Amazon S3 storage with Kubernetes, providing a user-friendly interface for containerized applications and compatibility across different Kubernetes deployment scenarios.

--

--