Skip to content

Commit

Permalink
Merge bcf525f into 706de0a
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheng Pan committed Feb 27, 2019
2 parents 706de0a + bcf525f commit d3dfe4a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 45 deletions.
2 changes: 1 addition & 1 deletion examples/kubernetes/dynamic_provisioning/README.md
Expand Up @@ -14,7 +14,7 @@ parameters:
securityGroupIds: sg-086f61ea73388fb6b
```
* subnetId - the subnet ID that the FSx for Lustre filesystem should be created inside.
* securityGroupIds - a list of security group IDs that should be attached to the filesystem
* securityGroupIds - a comman separated list of security group IDs that should be attached to the filesystem

### Edit [Persistent Volume Claim Spec](claim.yaml)
```
Expand Down
38 changes: 11 additions & 27 deletions examples/kubernetes/multiple_pods/README.md
@@ -1,40 +1,24 @@
## Multiple Pods Read Write Many
This example shows how to create a static provisioned FSx for Lustre PV and access it from multiple pods with RWX access mode.
This example shows how to create a dynamically provisioned FSx for Lustre PV and access it from multiple pods with `ReadWriteMany` access mode. If you are using static provisioning, following steps to setup static provisioned PV with access mode set to `ReadWriteMany` and the rest of steps of consuming the volume from pods are similar.

### Edit Persistent Volume
Edit persistent volume using sample [spec](pv.yaml):
### Edit [StorageClass](storageclass.yaml)
```
apiVersion: v1
kind: PersistentVolume
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: fsx-pv
spec:
capacity:
storage: 5Gi
volumeMode: Filesystem
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Recycle
storageClassName: fsx-sc
csi:
driver: fsx.csi.aws.com
volumeHandle: [FileSystemId]
volumeAttributes:
dnsname: [DNSName]
```
Replace `volumeHandle` with `FileSystemId` and `dnsname` with `DNSName`. Note that the access mode is `RWX` which means the PV can be read and write from multiple pods.

You can get both `FileSystemId` and `DNSName` using AWS CLI:

```sh
>> aws fsx describe-file-systems
name: fsx-sc
provisioner: fsx.csi.aws.com
parameters:
subnetId: subnet-056da83524edbe641
securityGroupIds: sg-086f61ea73388fb6b
```
* subnetId - the subnet ID that the FSx for Lustre filesystem should be created inside.
* securityGroupIds - a comman separated list of security group IDs that should be attached to the filesystem

### Deploy the Application
Create PV, persistence volume claim (PVC), storageclass and the pods that consume the PV:
```sh
>> kubectl apply -f examples/kubernetes/multiple_pods/storageclass.yaml
>> kubectl apply -f examples/kubernetes/multiple_pods/pv.yaml
>> kubectl apply -f examples/kubernetes/multiple_pods/claim.yaml
>> kubectl apply -f examples/kubernetes/multiple_pods/pod1.yaml
>> kubectl apply -f examples/kubernetes/multiple_pods/pod2.yaml
Expand Down
17 changes: 0 additions & 17 deletions examples/kubernetes/multiple_pods/pv.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions examples/kubernetes/multiple_pods/storageclass.yaml
Expand Up @@ -3,3 +3,6 @@ apiVersion: storage.k8s.io/v1
metadata:
name: fsx-sc
provisioner: fsx.csi.aws.com
parameters:
subnetId: subnet-056da83524edbe641
securityGroupIds: sg-086f61ea73388fb6b

0 comments on commit d3dfe4a

Please sign in to comment.