You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**WARNING**: This driver is in pre ALPHA currently. This means that there may potentially be backwards compatible breaking changes moving forward. Do NOT use this driver in a production environment in its current state.
4
6
@@ -16,91 +18,101 @@ This driver is in alpha stage. Basic volume operations that are functional inclu
Currently only static provisioning is supported. With static provisioning, a file cache should be created manually, then it could be mounted inside container as a persistence volume (PV) using File Cache CSI Driver.
This example shows how to make an Amazon File Cache availble inside container for the application to consume. Before this, get yourself familiar with how to setup kubernetes on AWS and [create an Amazon file cache](https://docs.aws.amazon.com/fsx/latest/FileCacheGuide/getting-started.html). And when creating an Amazon File Cache, make sure it is created inside the same VPC as kuberentes cluster or it is accessible through VPC peering.
29
+
## Amazon File Cache CSI Driver on Kubernetes
34
30
35
-
Once kubernetes cluster and an Amazon File Cache is created, create secret manifest file using [secret.yaml](../deploy/kubernetes/secret.yaml).
31
+
---------
32
+
The following sections are Kubernetes-specific. If you are a Kubernetes user, use the following for driver features, installation steps and examples.
* Static provisioning - Amazon File Cache needs to be created manually first, then it could be mounted inside container as a volume using the Driver.
46
+
* Dynamic provisioning (currently not supported) - uses persistent volume claim (PVC) to let Kubernetes create the Amazon File Cache for you and consumes the volume from inside container.
47
+
* Mount options - mount options can be specified in storageclass to define how the volume should be mounted.
41
48
42
-
Deploy the Amazon file cache CSI driver:
49
+
**Notes**:
50
+
* For dynamically provisioned volumes, only one subnet is allowed inside a storageclass's `parameters.subnetId`. This is a [limitation](https://docs.aws.amazon.com/fsx/latest/APIReference/API_FileCacheCreating.html#FSx-Type-FileCacheCreating-SubnetIds) that is enforced by Amazon File Cache.
51
+
52
+
### Installation
53
+
#### Set up driver permission
54
+
The driver requires IAM permission to talk to Amazon File Cache service to create/delete the filecache on user's behalf. There are several methods to grant driver IAM permission:
55
+
* Using secret object - create an IAM user with proper permission, put that user's credentials in [secret manifest](../deploy/kubernetes/secret.yaml) then deploy the secret.
After objects are created, verify that pod is running:
83
80
84
-
```sh
85
-
kubectl get pods
86
-
```
87
81
88
-
Make sure data is written onto Amazon File Cache:
89
82
90
-
```sh
91
-
kubectl exec -ti fc-app -- df -h
92
-
kubectl exec -it fc-app -- ls /data
93
-
```
83
+
84
+
------------------
85
+
86
+
87
+
### Examples
88
+
Before the example, you need to:
89
+
* Get yourself familiar with how to setup Kubernetes on AWS and [create Anmazon File Cache](https://docs.aws.amazon.com/fsx/latest/FileCacheGuide/getting-started.html) if you are using static provisioning.
90
+
* When creating Amazon File Cache, make sure its VPC is accessible from Kuberenetes cluster's VPC and network traffic is allowed by security group.
91
+
* For FSx for Lustre VPC, you can either create an Amazon File Cache inside the same VPC as Kubernetes cluster or using VPC peering.
92
+
* For security group, make sure port 988 is allowed for the security groups that are attached the lustre filesystem ENI.
93
+
* Install Amazon File Cache CSI driver following the [Installation](README.md#Installation) steps.
* [Accessing the filesystem from multiple pods](examples/kubernetes/multiple_pods/README.md)
94
99
95
100
## Development
101
+
102
+
----
96
103
Please go through [CSI Spec](https://github.com/container-storage-interface/spec/blob/master/spec.md) and [General CSI driver development guideline](https://kubernetes-csi.github.io/docs/Development.html) to get some basic understanding of CSI driver before you start.
97
104
98
105
### Requirements
99
-
* Golang 1.9+
106
+
* Golang 1.19.0+
107
+
108
+
### Dependency
109
+
Dependencies are managed through go module. To build the project, first turn on go mod using `export GO111MODULE=on`, to build the project run: `make`
100
110
101
111
### Testing
102
112
To execute all unit tests, run: `make test`
103
113
104
114
## License
115
+
116
+
----
105
117
This library is licensed under the Apache 2.0 License.
Copy file name to clipboardExpand all lines: examples/kubernetes/dynamic_provisioning/README.md
+25-13Lines changed: 25 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,33 +1,45 @@
1
1
## Dynamic Provisioning Example
2
+
3
+
---
4
+
2
5
*~Not yet supported~*
3
6
4
-
This example shows how to create an Amazon File Cache using persistence volume claim (PVC) and consumes it from a pod.
7
+
This example shows how to create an Amazon File Cache using persistence volume claim (PVC) and consumes it from a pod. Please see the [CreateFileCache API Reference](https://docs.aws.amazon.com/fsx/latest/APIReference/API_CreateFileCache.html#FSx-CreateFileCache-request-DataRepositoryAssociations) for more information.
*Update the parameters not marked as optional below.*
30
+
24
31
* subnetId - The subnet ID that the Amazon File Cache should be created inside.
25
-
* securityGroupIds - A comma separated list of security group IDs that should be attached to the filecache
26
-
* dataRepositoryAssociations - A list of IDs of data repository associations that are associated with this cache.
32
+
* securityGroupIds - A comma separated list of security group IDs that should be attached to the file cache.
33
+
* dataRepositoryAssociations - A space separated ist of up to 8 configurations for data repository associations (DRAs) to be created during the cache creation. The DRAs link the cache to either an Amazon S3 data repository or a Network File System (NFS) data repository that supports the NFSv3 protocol. Please see [DataRepositoryAssociations](https://docs.aws.amazon.com/fsx/latest/APIReference/API_CreateFileCache.html#FSx-CreateFileCache-request-DataRepositoryAssociations) for the File Cache DRA configurations requirements.
34
+
* copyTagsToDataRepositoryAssociations - A boolean flag indicating whether tags for the cache should be copied to data repository associations. This value defaults to false.
27
35
* fileCacheType (Optional) - The type of cache, which must be LUSTRE.
28
36
* fileCacheTypeVersion (Optional) - The Lustre version of the cache, which must be 2.12.
29
-
* LustreConfiguration (Optional) - The configuration for the Amazon File Cache resource, please view [FileCacheLustreConfiguration](https://docs.aws.amazon.com/fsx/latest/APIReference/API_FileCacheLustreConfiguration.html) for more details on the contents.
30
37
* weeklyMaintenanceStartTime (Optional) - The preferred start time to perform weekly maintenance, formatted d:HH:MM in the UTC time zone, where d is the weekday number, from 1 through 7, beginning with Monday and ending with Sunday. The default value is "7:09:00" (Sunday 09:00 UTC)
38
+
* kmsKeyId (Optional) - Specifies the ID of the Key Management Service (KMS) key to use for encrypting data on an Amazon File Cache. If a KmsKeyId isn't specified, the Amazon FSx-managed KMS key for your account is used.
39
+
* LustreConfiguration (Optional) - The configuration for the Amazon File Cache resource, please view [FileCacheLustreConfiguration](https://docs.aws.amazon.com/fsx/latest/APIReference/API_FileCacheLustreConfiguration.html) for more details on the contents.
40
+
* DeploymentType - Specifies the cache deployment type, which must be CACHE_1
41
+
* PerUnitStorageThroughput - Provisions the amount of read and write throughput for each 1 tebibyte (TiB) of cache storage capacity, in MB/s/TiB. The only supported value is 1000.
42
+
* MetadataConfiguration - The configuration for a Lustre MDT (Metadata Target) storage volume. The storage capacity of the Lustre MDT (Metadata Target) storage volume in gibibytes (GiB). The only supported value is 2400 GiB.
31
43
* extraTags (Optional) - Tags that will be set on the FSx resource created in AWS, in the form of a comma separated list with each tag delimited by an equals sign (example - "Tag1=Value1,Tag2=Value2") . Default is a single tag with CSIVolumeName as the key and the generated volume name as it's value.
Update `spec.resource.requests.storage` with the storage capacity to request. The storage capacity value will be rounded up to 1200 GiB, 2400 GiB, or a multiple of 3600 GiB for SSD. If the storageType is specified as HDD, the storage capacity will be rounded up to 6000 GiB or a multiple of 6000 GiB if the perUnitStorageThroughput is 12, or rounded up to 1800 or a multiple of 1800 if the perUnitStorageThroughput is 40.
59
+
*Update `spec.resource.requests.storage` with the storage capacity to request. The storage capacity value will be rounded up to 1200 GiB, 2400 GiB, or a multiple of 2400 GiB.*
48
60
49
61
### Deploy the Application
50
62
Create PVC, storageclass and the pod that consumes the PV:
@@ -64,5 +76,5 @@ After the objects are created, verify that pod is running:
64
76
Also verify that data is written onto Amazon File Cache:
0 commit comments