Mountpoint version 2: Why sidecars beat host daemons

Blog 15 min read

Mountpoint version 2 shifts to a sidecar architecture to present an Amazon S3 bucket as a storage volume for Kubernetes containers.

The Mountpoint CSI driver has evolved beyond simple attachment mechanisms, with version 2 introducing significant architectural changes compared to previous iterations. This update fundamentally alters how cloud-native applications access object storage, moving away from legacy mounting methods to a more reliable sidecar architecture. The driver, identified technically as s3.csi.aws.com, enables pods to treat S3 buckets like local disk space without managing complex infrastructure.

Readers will learn how this new architecture supports ReadWriteMany access modes, allowing multiple pods to mount the same bucket for simultaneous read and write operations. The guide also details configuring Static Provisioning via PersistentVolume and PersistentVolumeClaim resources to bind specific buckets to your deployments.

Implementing these configurations ensures that environment variables such as region=$AWS_REGION correctly map your storage resources. By defining a volumeHandle and specifying the bucketName in your YAML manifests, you can achieve horizontal scaling for image host applications. This approach eliminates the need for traditional block storage while maintaining the durability and scalability inherent to Amazon.

The Role of Mountpoint CSI Drivers in Modern Cloud-Native Storage

Mountpoint CSI Driver Architecture and EKS Pod Identity

Mountpoint for Amazon S3 operates as a CSI driver that exposes object storage as a POSIX-like file system for containerized applications. This design allows Amazon EKS workloads to interact with S3 buckets using standard file operations, removing the need for complex SDK integrations. Version 2 introduces a structural change by moving the `mount-s3` process from the host node into dedicated Mountpoint Pods. Isolating these processes stops a single mount failure from destabilizing the entire worker node, a frequent risk in shared-host architectures. This separation directly enables EKS Pod Identity, permitting fine-grained authentication where each pod assumes its own IAM role instead of inheriting broad node-level permissions. Security teams can now enforce least-privilege access policies at the individual workload level.

This architectural shift carries an operational cost: the dedicated pods consume additional cluster CPU and memory resources compared to host-level daemons. Operators must account for this overhead when sizing node groups for high-density deployments. The driver strictly requires static provisioning, meaning administrators must pre-define PersistentVolumes referencing existing buckets rather than dynamically creating storage on demand. Rabata.io recommends this isolated pattern specifically for multi-tenant clusters where security boundaries between workloads are paramount. The project, maintained under the awslabs organization, ensures compatibility with modern Kubernetes versions while adhering to strict supply chain security standards through hardened container images.

Static Provisioning Constraints for Existing S3 Buckets

Mountpoint for Amazon S3 requires pre-existing buckets because the driver supports static provisioning only. Generic file storage systems often dynamically allocate backend volumes upon request, yet this architecture mandates that administrators create the target S3 bucket before defining Kubernetes resources. The PersistentVolumeClaim acts as a static pointer to this external asset rather than a trigger for infrastructure creation. Operators must manually configure the PersistentVolume specification to reference the specific bucket name and region. This constraint prevents accidental resource sprawl but shifts the burden of lifecycle management entirely to the platform team. A common implementation pattern involves mounting an existing bucket containing large datasets or configuration files so multiple pods can share read access without data duplication.

Feature Flexible Provisioning Static Provisioning (Mountpoint)
Bucket Creation Automatic via API Manual (Pre-existing)
Lifecycle Owner Kubernetes Controller Administrator
Use Case Ephemeral test envs Shared datasets

Rigid coupling between cluster definitions and external storage state defines this approach. If the referenced bucket does not exist, the ReadWriteMany mount fails immediately, halting pod scheduling. Teams must align Amazon EKS deployment pipelines with cloud infrastructure code to guarantee bucket availability before applying driver manifests.

Security Risks of Host Node Mounting vs Dedicated Pods

Host-level mounting exposes the entire worker node to credential compromise if a single pod is breached. Traditional approaches often rely on node-level IAM roles, granting broad access rights that violate the principle of least privilege. Running the `mount-s3` process directly on the host creates a shared failure domain where a compromised container can potentially access credentials intended for other workloads.

The v2 architecture isolates this risk by executing the mounting logic within dedicated Mountpoint Pods. This separation ensures that EKS Pod Identity bindings apply strictly to the specific pod requiring storage access. Fine-grained control prevents lateral movement across the cluster if an application vulnerability is exploited. Using hardened container images addresses supply chain concerns by providing pre-validated binaries for production environments. Resource utilization increases when running separate processes for each mount point compared to a shared host daemon. Operators must size their node pools to accommodate this overhead while maintaining security boundaries. Granular security outweighs the marginal efficiency gains of shared host resources. Rabata.io recommends this isolated pattern for any multi-tenant Amazon EKS cluster handling sensitive data.

Inside the Sidecar Architecture of Mountpoint Version 2

Mechanics of the Dedicated Mountpoint Pod Isolation

Dedicated pods now host the `mount-s3` process instead of running it directly on the host node. This configuration isolates storage interactions so a single runaway mount operation cannot consume critical resources across the entire worker node. Containing logic within a specific boundary allows the system to use EKS Pod Identity for enforcing granular access controls tied strictly to the application pod. Static provisioning requires operators to define a PersistentVolume referencing an existing bucket before deployment. This approach differs from legacy daemons that shared host namespaces and often demanded broader IAM permissions. Running the driver as a sidecar keeps authentication credentials and network policies scoped to the specific workload.

Security gains introduce a resource cost. Each application pod needing S3 access spawns a companion mount pod, which increases overall CPU and memory consumption within the cluster. Operators managing high-density workloads must account for this overhead when sizing node groups. The isolation prevents credential leakage between tenants on multi-tenant nodes despite the expense. This design choice reflects a broader industry trend favoring granular security boundaries over shared host resources.rabata.io recommends this pattern for AI/ML training pipelines where data access must be strictly audited per job.

Configuring ReadWriteMany Access and UID Mapping

Explicit `uid=1000` and `gid=1000` parameters enable ReadWriteMany access by aligning file ownership with container runtime expectations. Pods running as non-root users frequently encounter permission denied errors when attempting to write to the shared S3 bucket without these specific mount options. The configuration mandates that operators define these identifiers directly within the PersistentVolume specification to ensure consistent access across all replicas. Multiple pods can simultaneously read and modify objects, a capability necessary for horizontal scaling in Amazon EKS clusters. The `allow-delete` flag further permits applications to remove objects, mirroring local filesystem behavior while maintaining the underlying object storage semantics. Operators must note that the driver requires an existing S3 bucket to function, meaning users must account for the underlying storage pricing tier associated with that bucket (https://github.com/awslabs/mountpoint-s3-csi-driver/blob/main/examples/kubernetes/static_provisioning/README.md).

Shared access flexibility creates tension with data integrity. Concurrent writes from multiple pods can lead to last-write-wins scenarios if application logic lacks coordination. Object storage does not provide file-level locking mechanisms natively unlike block storage. Engineers must implement application-level semaphores or rely on single-writer patterns despite the multi-writer capability.rabata.io recommends validating these permission matrices in staging environments before enabling production traffic to prevent silent data corruption or accessibility outages.

Validation Steps for Static S3 Bucket References

Verify the target S3 bucket exists and matches the region parameters before attempting to bind the PersistentVolumeClaim. The driver supports static provisioning only, so the referenced bucket must pre-exist since the system cannot dynamically create storage on demand. Operators must confirm the volumeAttributes explicitly include the `region` parameter set to `$AWS_REGION` to correctly identify the bucket location. A mismatch here causes the PersistentVolume to remain pending indefinitely, blocking pod scheduling. The following comparison highlights critical validation differences between flexible and static approaches:

  1. Confirm the bucket name in `volumeAttributes` matches the actual resource exactly.
  2. Validate that the AWS region in the manifest aligns with the bucket's physical location.
  3. Ensure the cluster's IAM identity possesses `s3:ListBucket` permissions for the specific path.

Failure to validate these constraints results in a stuck provisioner loop. Static provisioning offers no fallback creation mechanism unlike flexible systems, making pre-deployment checks mandatory for stability.

Configuring Static Provisioning and Volume Claims for S3 Buckets

Defining PersistentVolume and PersistentVolumeClaim Parameters for S3 CSI

The `s3pvclaim.yaml` manifest establishes a PersistentVolume named s3-pv alongside a PersistentVolumeClaim labeled s3-claim. This setup anchors static provisioning, a mandatory approach for the Mountpoint CSI driver since it lacks flexible volume creation capabilities. The PersistentVolume specification declares a capacity of 1Gi and sets accessModes to ReadWriteMany, enabling concurrent read-write access across multiple pods within the cluster.

Operators configure specific mountOptions to manage file permissions and safety boundaries. The `allow-delete` flag permits object removal, while `uid` and `gid` parameters map file ownership to non-root user contexts required by secure container runtimes. Because the driver supports static provisioning only, the volumeAttributes field must reference an existing bucket name rather than generating new infrastructure. The PersistentVolumeClaim binds to this definition using an empty `storageClassName`, ensuring the claim targets the pre-set volume exactly. ReadWriteMany enables high-availability scaling, yet enabling `allow-delete` on a shared bucket introduces data integrity risks if application logic lacks strict concurrency controls.rabata.io recommends validating these permission maps in staging before applying them to production AI/ML training pipelines where data immutability is often preferred.

Applying Kustomize Patches to Update Deployment Volume Mounts

Injecting the volumeMounts into the `ui` deployment requires a Kustomize patch that targets the specific container spec. This step attaches the pre-existing s3-claim to the `/mountpoint-s3` path, satisfying the driver's strict requirement for static provisioning only. Without this explicit binding, the pod cannot access the shared object store.

The patch modifies the `ui` deployment in the `ui` namespace, setting replicas to 2 and defining the environment variable `RETAIL_UI_PRODUCT_IMAGES_PATH`. Operators must ensure the image reference matches `public.ecr.aws/aws-containers/retail-store-sample-ui:1.2.1` to maintain compatibility with the mounted file system structure.

Apply the configuration using `kubectl kustomize` piped through `envsubst` to resolve bucket variables before submission. ReadWriteMany mode enables horizontal scaling, but the application must handle potential latency spikes during initial object retrieval.rabata.io recommends validating the `rollout status` immediately after applying the patch to confirm the sidecar mounts successfully before traffic shifts.

Validating Security Context and Resource Limits in S3 Mount Configurations

Enforcing `runAsNonRoot: true` prevents the container from executing as root, strictly limiting blast radius during potential breaches. Operators must set `runAsUser: 1000` alongside `readOnlyRootFilesystem: true` to satisfy least privilege principles. These settings ensure that even if an attacker compromises the application process, they cannot modify system binaries or escalate privileges on the host node.

Resource exhaustion poses a separate risk when processing large media datasets or AI training batches. Configuring `memory` limits to `1.5Gi` and `cpu` requests to `250m` prevents a single runaway pod from starving neighboring workloads on the same node. This discipline is necessary because the Mountpoint driver buffers data locally during high-throughput operations.

Setting Value Purpose
runAsUser 1000 Enforces non-root execution
memory limits 1.5Gi Prevents node starvation
cpu requests 250m Guarantees scheduling priority

Enterprises requiring strict supply chain compliance often apply Chainguard hardened images to guarantee the mounting component remains untampered. Increased configuration complexity accompanies this rigid security posture; a single missing capability drop can cause the pod to fail startup.rabata.io recommends validating these constraints in staging before production rollout to avoid availability gaps.

Validating Shared File Access Across Replicated Pods

ReadWriteMany Access Modes for S3-Backed PersistentVolumes

ReadWriteMany (RWX) access modes allow multiple pod replicas to simultaneously mount and modify the same S3 bucket contents. Unlike traditional block storage limited to single-node attachment, this capability enables true shared file system behavior across a cluster. The persistentvolume/s3-pv configuration explicitly declares `ReadWriteMany` access modes with a `Retain` reclaim policy, ensuring data persistence independent of pod lifecycle. Operators define this static volume with 1Gi listed capacity, though the underlying object store scales dynamically.

The Mountpoint CSI driver enables this by presenting Amazon S3 as a storage volume through static provisioning only, requiring pre-existing buckets rather than flexible creation. This architecture supports scenarios where horizontal scaling demands concurrent write access to a common dataset, such as shared media assets or distributed training data. However, enabling `allow-delete` mount options introduces risk; any pod with write access can remove objects, necessitating strict IAM controls via EKS Pod Identity.

Traditional CSI drivers often struggle with concurrent writes due to locking mechanisms inherent in block protocols. S3-backed RWX bypasses these limitations by using object versioning and eventual consistency models native to cloud storage. The trade-off is that applications must handle potential race conditions when multiple pods modify the same object key simultaneously.rabata.io recommends this pattern for read-heavy workloads with occasional coordinated writes, avoiding it for high-frequency transactional updates requiring strong immediate consistency.

Verifying Data Consistency Across Replicated UI Pods

Applying the Kustomize overlay via `kubectl kustomize` triggers the deployment.apps/ui configuration, binding two pod replicas to the shared persistentvolume/s3-pv.

The rollout completes within the 180-second timeout, yielding two running instances: ui-9fbbbcd6f-c74vv and ui-9fbbbcd6f-vb9jz, both reporting zero restarts. This static provisioning model relies on pre-set volume handles rather than flexible creation, a constraint operators must address before scaling. Unlike hostPath volumes that risk node-level contention, this architecture isolates the mount process, effectively creating private elevators for each container to access the storage backend Visual Metaphor. The trade-off is the additional resource overhead required to maintain these dedicated sidecar pods alongside the application containers.

To validate cross-pod consistency, a write operation targets the `/mountpoint-s3` directory on the first replica using a curl command to fetch a placeholder image. Immediate verification on the second replica confirms the new placeholder.jpg file appears alongside the original twelve images without manual synchronization. Listing the bucket contents via `aws s3 ls` corroborates the local view, showing the updated object count and matching timestamps. This workflow proves that ReadWriteMany access modes function correctly across distinct pods, ensuring that data written by one instance is instantly visible to others.

However, reliance on eventual consistency in the underlying object store can introduce brief latency windows where new writes are not immediately readable by all clients. Architects should verify application retry logic handles these transient states gracefully during high-velocity write periods. For organizations requiring strict consistency guarantees, implementing EKS Pod Identity provides the necessary security context without complicating the node IAM roles.rabata.io recommends this validation step as a mandatory gate before promoting workloads to production environments.

Checklist for Validating S3 Mountpoint Timestamps and URLs

Confirm cross-pod data consistency by verifying file metadata matches the S3 backend immediately after writes. Operators must inspect the file timestamps to ensure the new `placeholder.jpg` reflects `2025-07-09 15:10:27`, distinct from the original batch at `14:43:36`. Byte-size validation provides a secondary checksum; the placeholder image must strictly measure `10024` bytes, whereas source assets range between `97592` and `171045` bytes.

Attribute Expected Value Validation Method
Timestamp 2025-07-09 15:10:27 `ls -l` on second pod
Size 10024 bytes `du -b` comparison
Access HTTP 200 OK Load balancer URL test

Construct the final load balancer hostname URL to verify UI visibility: `k8s-ui-uinlb-647e781087-6717c5049aa96bd9.elb.us This step confirms the static provisioning chain extends from the S3 bucket through the CSI driver to the external network edge. A failure here often indicates a lag in the mount synchronization rather than a storage write error. Unlike flexible volumes, these shared assets require manual verification of the specific object keys since the driver does not auto-generate paths. Teams should adopt this checklist to prevent silent data availability gaps in production.rabata.io recommends automating these metadata checks within CI/CD pipelines to enforce strict integrity before traffic shifts. The cost of skipping this validation is potential asset corruption visible only to end users.

About

Alex Kumar is a Senior Platform Engineer and Infrastructure Architect at Rabata.io, where he specializes in Kubernetes storage architecture and cost-effective cloud solutions. His daily work involves designing resilient persistent storage systems, making him uniquely qualified to detail the deployment of the Mountpoint for Amazon S3 CSI driver. At Rabata.io, an S3-compatible object storage provider, Alex routinely configures Persistent Volumes to enable high-performance data access for AI/ML startups and enterprise clients. This article directly reflects his hands-on experience optimizing containerized applications that require scalable, S3-backed storage without vendor lock-in. By using his expertise in CSI drivers and infrastructure-as-code, Alex demonstrates how organizations can achieve significant cost savings compared to traditional providers while maintaining GDPR compliance and superior throughput. His practical insights bridge the gap between theoretical configuration and production-ready cloud-native storage strategies.

Conclusion

Scaling this architecture reveals that manual metadata checks become unsustainable as pod counts increase, creating an operational bottleneck where data consistency lags behind deployment velocity. While the current 180-second timeout ensures rapid rollout, relying on human verification for byte-size and timestamp alignment introduces unacceptable risk in high-frequency release cycles. Organizations must transition from ad-hoc validation to automated integrity gates that enforce strict parity between local mounts and S3 backend states before traffic shifts.

Teams should mandate EKS Pod Identity integration for all new storage classes to eliminate broad node-level permissions, aligning with the industry shift toward granular security contexts. This migration is not merely a security enhancement but a prerequisite for multi-tenant stability where credential leakage could compromise entire clusters. Start by scripting a byte-size comparison using `du -b` within your CI/CD pipeline to block deployments where the placeholder image deviates from the expected 10024 bytes. This specific check catches synchronization failures that standard health probes miss, ensuring the Mountpoint CSI driver correctly presents the bucket as a reliable volume. By automating this single metric, operators gain immediate visibility into mount health without waiting for end-user reports of missing assets.

Frequently Asked Questions

The ReadWriteMany mount fails immediately if the bucket is missing. Administrators must manually create the target storage before defining PersistentVolume resources to avoid deployment errors.

Isolating processes stops a single mount failure from destabilizing the entire worker node. This separation allows dedicated Mountpoint Pods to run without risking broader cluster infrastructure availability.

The driver supports static provisioning only and cannot dynamically create buckets. Operators must pre-define PersistentVolumes referencing existing storage assets rather than relying on automatic infrastructure creation.

Flags like allow-delete and allow-other govern file deletion and user permissions. These options must be explicitly added to mountOptions to permit users other than the owner to access data.

The sample deployment specifies two replicas to demonstrate horizontal scaling capabilities. This configuration allows multiple pods to simultaneously mount the same bucket for shared read and write operations.