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
-
5
-
**DISCLAIMER**: This is not an officially supported Amazon product
6
-
7
3
## Amazon File Cache CSI Driver
8
4
### Overview
9
5
@@ -44,13 +40,21 @@ The following sections are Kubernetes-specific. If you are a Kubernetes user, us
44
40
* 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.
45
41
46
42
### Installation
47
-
#### 1. Set a few variables to use in the remaining steps. Replace `my-csi-file-cache` with the name of the test cluster you want to create and `region-code` with the AWS Region that you want to create your test cluster in.
43
+
44
+
#### Prerequisites
45
+
You must have:
46
+
* The AWS CLI installed and configured on your device or AWS CloudShell. You can check your current version with `aws --version | cut -d / -f2 | cut -d ' ' -f1`. Package managers such `yum`, `apt-get`, or Homebrew for macOS are often several versions behind the latest version of the AWS CLI. To install the latest version, see [Installing, updating, and uninstalling the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [Quick configuration with aws configure](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html#cli-configure-quickstart-config) in the AWS Command Line Interface User Guide. The AWS CLI version installed in the AWS CloudShell may also be several versions behind the latest version. To update it, see [Installing AWS CLI to your home directory](https://docs.aws.amazon.com/cloudshell/latest/userguide/vm-specs.html#install-cli-software) in the AWS CloudShell User Guide.
47
+
* The `eksctl` command line tool installed on your device or AWS CloudShell. To install or update `eksctl`, see [Installing or updating eksctl](https://docs.aws.amazon.com/eks/latest/userguide/eksctl.html).
48
+
* The `kubectl` command line tool is installed on your device or AWS CloudShell. The version can be the same as or up to one minor version earlier or later than the Kubernetes version of your cluster. To install or upgrade `kubectl`, see [Installing or updating kubectl](https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html).
49
+
50
+
51
+
1. Set a few variables to use in the remaining steps. Replace `my-csi-file-cache` with the name of the test cluster you want to create and `region-code` with the AWS Region that you want to create your test cluster in.
48
52
```shell
49
53
export cluster_name=my-csi-file-cache
50
54
export region_code=region-code
51
55
```
52
56
53
-
#### 2. Create a test cluster.
57
+
2. Create a test cluster.
54
58
```shell
55
59
eksctl create cluster \
56
60
--name $cluster_name \
@@ -60,7 +64,8 @@ eksctl create cluster \
60
64
--ssh-public-key my-key
61
65
```
62
66
63
-
#### 3. Set up driver permission
67
+
3. Set up driver permission
68
+
64
69
The driver requires IAM permission to talk to Amazon File Cache service to create/delete the file cache on user's behalf. There are several methods to grant driver IAM permission:
65
70
66
71
* Create a Kubernetes service account for the driver and attach the `AmazonFSxFullAccess` AWS-managed policy to the service account with the following command. If your cluster is in the AWS GovCloud (US-East) or AWS GovCloud (US-West) AWS Regions, then replace `arn:aws:` with `arn:aws-us-gov:`.
#### To deploy a Kubernetes storage class, persistent volume claim, and sample application to verify that the CSI driver is working
195
+
196
+
1. Note the security group for your cluster. You can see it in the AWS Management Console under the Networking section or by using the following AWS CLI command.
2. Create a security group for your Amazon FSx file cache according to the criteria shown in [Amazon VPC Security Groups](https://docs.aws.amazon.com/fsx/latest/FileCacheGuide/limit-access-security-groups.html#fsx-vpc-security-groups) in the Amazon File Cache User Guide. For the **VPC**, select the VPC of your cluster as shown under the **Networking** section. For "the security groups associated with your Lustre clients", use your cluster security group. You can leave the outbound rules alone to allow **All traffic**.
203
+
204
+
3. Download the storage class manifest with the following command.
4. Edit the parameters section of the `storageclass.yaml` file. Replace every `example value` with your own values.
211
+
212
+
For information about the other parameters, see [Edit StorageClass](https://github.com/kubernetes-sigs/aws-file-cache-csi-driver/tree/main/examples/kubernetes/dynamic_provisioning#edit-storageclass).
***subnetId** – The subnet ID that the Amazon FSx file cache should be created in. Amazon FSx file cache isn't supported in all Availability Zones. Open the Amazon FSx Caches page at https://console.aws.amazon.com/fsx/#fc/file-caches/ to confirm that the subnet that you want to use is in a supported Availability Zone. The subnet can include your nodes, or can be a different subnet or VPC:
225
+
* You can check for the node subnets in the AWS Management Console by selecting the node group under the Compute section.
226
+
* If the subnet that you specify isn't the same subnet that you have nodes in, then your VPCs must be connected, and you must ensure that you have the necessary ports open in your security groups.
227
+
***securityGroupIds** – The ID of the security group you created for the file cache.
228
+
***dataRepositoryAssociations** – A list 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 cache (NFS) data repository that supports the NFSv3 protocol.
229
+
***other parameters (optional)** – For information about the other parameters, see Edit StorageClass on GitHub.
7. (Optional) Edit the `claim.yaml` file. Change `1200Gi` to an incremental value of **1.2 TiB**
247
+
```shell
248
+
storage: 1200Gi
249
+
```
250
+
251
+
8. Create the persistent volume claim.
252
+
```shell
253
+
kubectl apply -f claim.yaml
254
+
```
255
+
256
+
The example output is as follows.
257
+
```shell
258
+
persistentvolumeclaim/fc-claim created
259
+
```
260
+
261
+
9. Confirm that the file cache is provisioned.
262
+
263
+
```shell
264
+
kubectl describe pvc
265
+
```
266
+
267
+
The example output is as follows.
268
+
```shell
269
+
Name: fc-claim
270
+
Namespace: default
271
+
StorageClass: fc-sc
272
+
Status: Bound
273
+
```
274
+
275
+
***Note:** The `Status` may show as `Pending` for 5-10 minutes, before changing to `Bound`. Don't continue with the next step until the `Status` is `Bound`. If the `Status` shows `Pending` for more than 10 minutes, use warning messages in the `Events` as reference for addressing any problems.*
13. Verify that data was written to the Amazon File Cache by the sample app.
311
+
```shell
312
+
kubectl exec -it fc-app -- ls /data
313
+
```
314
+
The example output is as follows.
315
+
```shell
316
+
out.txt
317
+
```
318
+
This example output shows that the sample app successfully wrote the out.txt file to the file cache.
319
+
320
+
***Note:**
321
+
Before deleting the cluster, make sure to delete the Amazon File Cache. For more information, see [Clean up resources](https://docs.aws.amazon.com/fsx/latest/FileCacheGuide/getting-started-step4.html) in the Amazon File Cache User Guide.*
322
+
190
323
### Examples
191
324
Before the example, you need to:
192
325
* Get yourself familiar with how to setup Kubernetes on AWS and [create Amazon File Cache](https://docs.aws.amazon.com/fsx/latest/FileCacheGuide/getting-started.html) if you are using static provisioning.
@@ -215,6 +348,4 @@ To execute all unit tests, run: `make test`
215
348
216
349
## License
217
350
218
-
219
-
This library is licensed under the Apache 2.0 License.
220
-
351
+
This library is licensed under the Apache 2.0 License.
0 commit comments