-
Notifications
You must be signed in to change notification settings - Fork 807
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Multi-Attach for io2 block devices
Signed-off-by: Eddie Torres <[email protected]>
- Loading branch information
Showing
9 changed files
with
704 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Multi-Attach | ||
|
||
The multi-attach capability allows you to attach a single EBS volume to multiple EC2 instances located within the same Availability Zone (AZ). This shared volume can be utilized by several pods running on distinct nodes. | ||
|
||
## Important | ||
|
||
- EBS Multi-Attach does not support standard file systems. Standard file systems such as `XFS`, `EXT3`, `EXT4`, and `NTFS` aren't designed to be simultaneously accessed by multiple servers or EC2 instances. | ||
- Simultaneous access to a standard file system can result in data corruption or data loss. | ||
- You should use a clustered file system to ensure data resiliency and reliability for your production workloads. | ||
- Multi-Attach is only enabled for `IO2` block devices. | ||
|
||
Refer to the official AWS documentation on [Multi-Attach](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volumes-multi.html) for more information, best practices, and limitations of this capability. | ||
|
||
## Example | ||
|
||
1. Create a `StorageClass` referencing an `IO2` volume type: | ||
``` | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: ebs-sc | ||
provisioner: ebs.csi.aws.com | ||
volumeBindingMode: WaitForFirstConsumer | ||
parameters: | ||
type: io2 | ||
iops: "1000" | ||
``` | ||
|
||
2. Create a `PersistentVolumeClaim` referencing the `ReadWriteMany` access and `Block` device modes: | ||
``` | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: block-claim | ||
spec: | ||
accessModes: | ||
- ReadWriteMany | ||
volumeMode: Block | ||
storageClassName: ebs-sc | ||
resources: | ||
requests: | ||
storage: 4Gi | ||
``` | ||
|
||
3. Create a `DaemonSet` to deploy the driver on all nodes: | ||
``` | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: app-daemon | ||
spec: | ||
selector: | ||
matchLabels: | ||
name: app | ||
template: | ||
metadata: | ||
labels: | ||
name: app | ||
spec: | ||
containers: | ||
- name: app | ||
image: busybox | ||
command: ["/bin/sh", "-c"] | ||
args: ["tail -f /dev/null"] | ||
volumeDevices: | ||
- name: data | ||
devicePath: /dev/xvda | ||
volumes: | ||
- name: data | ||
persistentVolumeClaim: | ||
claimName: block-claim | ||
``` | ||
|
||
4. Verify the `DaemonSet` is running: | ||
``` | ||
$ kubectl get pods -A | ||
NAMESPACE NAME READY STATUS RESTARTS AGE | ||
default app-daemon-9hdgw 1/1 Running 0 18s | ||
default app-daemon-xm8zr 1/1 Running 0 18s | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.