|
1 | | -# aws-file-cache-csi-driver |
| 1 | +[](https://travis-ci.org/aws/aws-fsx-csi-driver) |
2 | 2 |
|
3 | | -Amazon File Cache Cloud Container Storage Interface(CSI) Driver |
| 3 | +**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 | 4 |
|
5 | | -## Community, discussion, contribution, and support |
| 5 | +**DISCLAIMER**: This is not an officially supported Amazon product |
6 | 6 |
|
7 | | -Learn how to engage with the Kubernetes community on the [community page](http://kubernetes.io/community/). |
| 7 | +## Amazon File Cache CSI Driver |
| 8 | +### Overview |
8 | 9 |
|
9 | | -You can reach the maintainers of this project at: |
| 10 | +The [Amazon File Cache]() Container Storage Interface (CSI) Driver provides a [CSI]() interface used by container orchestrators to manage the lifecycle of Amazon file cache volumes. |
10 | 11 |
|
11 | | -- [Slack](https://kubernetes.slack.com/messages/sig-cloud-provider) |
12 | | -- [Mailing List](https://groups.google.com/forum/#!forum/kubernetes-sig-cloud-provider) |
| 12 | +This driver is in alpha stage. Basic volume operations that are functional include NodePublishVolume/NodeUnpublishVolume. |
13 | 13 |
|
14 | | -### Code of conduct |
| 14 | +### CSI Specification Compability Matrix |
| 15 | +| AWS File Cache CSI Driver \ CSI Version | v1.0.0| |
| 16 | +|---------------------------------------------------|-------| |
| 17 | +| master branch | yes | |
| 18 | + |
| 19 | +### Kubernetes Version Compability Matrix |
| 20 | +| AWS File Cache CSI Driver \ Kubernetes Version | v1.17+ | |
| 21 | +|---------------------------------------------------|--------| |
| 22 | +| master branch | yes | |
| 23 | + |
| 24 | +## Features |
| 25 | +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. |
| 26 | + |
| 27 | +The following CSI interfaces are implemented: |
| 28 | +* Controller Service: |
| 29 | +* Node Service: NodePublishVolume, NodeUnpublishVolume, NodeGetCapabilities, NodeGetInfo, NodeGetId |
| 30 | +* Identity Service: GetPluginInfo, GetPluginCapabilities, Probe |
| 31 | + |
| 32 | +## Examples |
| 33 | +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. |
| 34 | + |
| 35 | +Once kubernetes cluster and an Amazon File Cache is created, create secret manifest file using [secret.yaml](../deploy/kubernetes/secret.yaml). |
| 36 | + |
| 37 | +Then create the secret object: |
| 38 | +```sh |
| 39 | +kubectl apply -f deploy/kubernetes/secret.yaml |
| 40 | +``` |
| 41 | + |
| 42 | +Deploy the Amazon file cache CSI driver: |
| 43 | + |
| 44 | +```sh |
| 45 | +kubectl apply -k deploy/kubernetes/base/ |
| 46 | +``` |
| 47 | + |
| 48 | +Edit the [persistence volume manifest file](../examples/kubernetes/static_provisioning/specs/pv.yaml): |
| 49 | +```sh |
| 50 | +apiVersion: v1 |
| 51 | +kind: PersistentVolume |
| 52 | +metadata: |
| 53 | + name: fc-pv |
| 54 | +spec: |
| 55 | + capacity: |
| 56 | + storage: 1200Gi |
| 57 | + volumeMode: FileCache |
| 58 | + accessModes: |
| 59 | + - ReadWriteOnce |
| 60 | + persistentVolumeReclaimPolicy: Recycle |
| 61 | + storageClassName: fc-sc |
| 62 | + csi: |
| 63 | + driver: file.cache.csi.aws.com |
| 64 | + volumeHandle: [FileCacheId] |
| 65 | + volumeAttributes: |
| 66 | + dnsname: [DNSName] |
| 67 | +``` |
| 68 | +Replace `volumeHandle` with `FileCacheId` and `dnsname` with `DNSName`. You can get both `FileCacheId` and `DNSName` using AWS CLI: |
| 69 | + |
| 70 | +```sh |
| 71 | +aws fsx describe-file-caches |
| 72 | +``` |
| 73 | + |
| 74 | +Then create PV, persistence volume claim (PVC) and storage class: |
| 75 | +```sh |
| 76 | +kubectl apply -f examples/kubernetes/dynamic_provisioning/specs/storageclass.yaml |
| 77 | +kubectl apply -f examples/kubernetes/dynamic_provisioning/specs/pv.yaml |
| 78 | +kubectl apply -f examples/kubernetes/dynamic_provisioning/specs/claim.yaml |
| 79 | +kubectl apply -f examples/kubernetes/dynamic_provisioning/specs/pod.yaml |
| 80 | +``` |
| 81 | + |
| 82 | +After objects are created, verify that pod is running: |
| 83 | + |
| 84 | +```sh |
| 85 | +kubectl get pods |
| 86 | +``` |
| 87 | + |
| 88 | +Make sure data is written onto Amazon File Cache: |
| 89 | + |
| 90 | +```sh |
| 91 | +kubectl exec -ti fc-app -- df -h |
| 92 | +kubectl exec -it fc-app -- ls /data |
| 93 | +``` |
| 94 | + |
| 95 | +## Development |
| 96 | +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 | + |
| 98 | +### Requirements |
| 99 | +* Golang 1.9+ |
| 100 | + |
| 101 | +### Testing |
| 102 | +To execute all unit tests, run: `make test` |
| 103 | + |
| 104 | +## License |
| 105 | +This library is licensed under the Apache 2.0 License. |
15 | 106 |
|
16 | | -Participation in the Kubernetes community is governed by the [Kubernetes Code of Conduct](code-of-conduct.md). |
|
0 commit comments