-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Container Storage Interface (CSI) #13435
Conversation
Automated checks report:
Some checks failed. Please fix the reported issues and reply 'alluxio-bot, check this please' to re-run checks. |
Codecov Report
@@ Coverage Diff @@
## master #13435 +/- ##
============================================
+ Coverage 43.66% 43.70% +0.04%
- Complexity 9061 9071 +10
============================================
Files 1384 1384
Lines 80308 80308
Branches 9768 9768
============================================
+ Hits 35063 35097 +34
+ Misses 42309 42276 -33
+ Partials 2936 2935 -1
Continue to review full report at Codecov.
|
List the requirements here
|
Automated checks report:
All checks passed! |
@maobaolong Please help to review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for bring alluxio-csi to alluxio repo, left some comments, please take a look.
integration/csi/README.md
Outdated
@@ -0,0 +1,80 @@ | |||
# Alluxio CSI | |||
|
|||
This project implement contienr storage interface(https://github.com/container-storage-interface/spec) for Alluxio. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This project -> This module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
) | ||
|
||
const ( | ||
driverName = "alluxio" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a hardcode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, driver name is hardcode. k8s will use this name to find correct csi-controller
and node-plugin
. And storage and driver should have one to one relationship.
command := exec.Command("/opt/alluxio/integration/fuse/bin/alluxio-fuse", args...) | ||
|
||
masterConfig := "" | ||
if masterHost, ok := req.GetVolumeContext()["alluxio.master.hostname"]; ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to specify a alluxio.master.hostname
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under parameters
filed of storage class
such as:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: alluxio
provisioner: alluxio
parameters:
alluxio.master.hostname: master_ip
volumeBindingMode: Immediate
But this can only be set in javaOptions
filed. Add this option here just for backward compatibility
https://github.com/Alluxio/alluxio/blob/master/integration/fuse/bin/alluxio-fuse | ||
*/ | ||
|
||
alluxioPath := req.GetVolumeContext()["alluxioPath"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be better to have the following logic
- Create an under storage space, for example ozone, s3, ceph bucket, or hdfs, cephfs folder.
- Create an alluxio mount point to the new under storage space.
When NodeUnpublishVolume, clear the new under storage space and umount the mount point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ozone, s3, ceph
is the under file system, only admin need to aware about this. So admin can create such folder in alluxio filesystem namespace, and mount different UFS. And provide correct storageClass such as: alluxio-ozon, alluxio-s3, alluxio-ceph.
For end user, if they want to use the storage, he/she can decide to use which storageClass or use many of them. And mount to different container path according to POD config
@@ -0,0 +1,481 @@ | |||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's auto generated, we should not change this file
integration/kubernetes/helm-chart/alluxio/templates/csi/driver.yaml
Outdated
Show resolved
Hide resolved
{{ if .Values.csi.clientEnabled -}} | ||
--- | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to abstract the storageClass to an individual file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@maobaolong For end of line issue, if there no "\n" at the end of file, github will show: |
@Binyang2014 Sorry, got it, thanks for share this tip. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some minor comments, LGTM
integration/csi/README.md
Outdated
@@ -0,0 +1,79 @@ | |||
# Alluxio CSI | |||
|
|||
This module implement contienr storage interface(https://github.com/container-storage-interface/spec) for Alluxio. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contienr -> container
integration/csi/README.md
Outdated
|
||
## Requirements | ||
|
||
Kubernetes 1.14 or higher, RBAC enbaled in API server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the whole name and link for RBAC since it's a name quite unfamiliar for users include me
## Usage | ||
|
||
### Deploy | ||
Please use `helm-generate.sh` to generate related templates. All CSI related templates should under `integration/kubernetes/<deploy-mode>/csi` folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add line between Deploy and Please
|
||
You can custmomize alluxio volumes via serveral configurations. | ||
|
||
The options you can customized: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
customize
integration/csi/README.md
Outdated
| Options | Description | | ||
| --- | --- | | ||
| `alluxioPath` | The path in alluxio | | ||
| `javaOptions` | The customized options which pass to fuse daemon | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which pass -> which will be passed
integration/csi/main.go
Outdated
} | ||
|
||
/* | ||
Based on https://github.com/openshift/origin/blob/master/pkg/util/proc/reaper.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this link cannot be opened, try using a permanent link instead of the master branch link
@LuQQiu @apc999.
|
@Binyang2014 If we can, I hope we can maintain an all-in-one alluxio image, it include alluxio main services, fuse and csi in the future. For this PR, it looks good now. |
@Binyang2014 @maobaolong We plan to deprecate the alluxio-fuse image since the current alluxio docker image contains the fuse logics as well. @jiacheliu3 can you help review the helm-chart related code in this PR? and give @Binyang2014 some suggestions for how to test them out? |
@LuQQiu We need to put CSI binary into image, it just about 13MB. |
@Binyang2014 then it's totally acceptable to put it in the docker image. Are the CSI binaries included in this PR, or how can we build the CSI binaries? |
@jiacheliu3 can you take a look at the helmchart part? |
@LuQQiu Please refer this dockerfile https://github.com/Binyang2014/alluxio/blob/binyli%2Fcsi/integration/csi/Dockerfile |
@Binyang2014 can you help move the CSI DockerFile logics into Alluxio DockerFile in this PR or the future PRs and update the related documentations? |
Doc updated. Will create an other PR to put CSi bit into alluxio Dockerfile. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Binyang2014 ! Sorry about the late review. My comments are majorly about parameterizing in the helm chart you added. I think it makes sense to be able to configure a few of them. I'm open to discussions :)
heritage: {{ .Release.Service }} | ||
role: alluxio-csi-controller | ||
spec: | ||
hostNetwork: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if there's a need to enable hostNetwork=false?
integration/kubernetes/helm-chart/alluxio/templates/csi/controller.yaml
Outdated
Show resolved
Hide resolved
attachRequired: false | ||
podInfoOnMount: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if these should be parameterized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These parameters used by developer. Admin/users don't need to take care
integration/kubernetes/helm-chart/alluxio/templates/csi/pv.yaml
Outdated
Show resolved
Hide resolved
integration/kubernetes/helm-chart/alluxio/templates/csi/pvc-static.yaml
Outdated
Show resolved
Hide resolved
integration/kubernetes/helm-chart/alluxio/templates/csi/pvc.yaml
Outdated
Show resolved
Hide resolved
integration/kubernetes/helm-chart/alluxio/templates/csi/pv.yaml
Outdated
Show resolved
Hide resolved
integration/kubernetes/helm-chart/alluxio/templates/csi/pvc.yaml
Outdated
Show resolved
Hide resolved
Co-authored-by: Jiacheng Liu <jiacheliu3@gmail.com>
@jiacheliu3 Thanks for review, please take a look again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Binyang2014 ! Left a minor comment, LGTM. If you could resolve that minor comment that'd be even better :)
Add comments for these fields. Thx |
Error: 9.429 [ERROR] Errors: |
@Binyang2014 Can you help merge master into your csi branch and update this PR? I doubt that the RaftJournalTest is already fixed in the master branch. |
alluxio-bot, merge this please |
## What changes are proposed in this pull request? This PR integrates Alluxio CSI from community maintained repo (https://github.com/Alluxio/alluxio-csi) to main repo, with further improvement ## Why are the changes needed? Original CSI repo is not as well curated and managed as the main repo. Given we have more ## Does this PR introduce any user facing changes? Yes, see the following example ### Deploy Go to `deploy` folder, Run following commands: ```bash kubectl apply -f csi-alluxio-driver.yml kubectl apply -f csi-alluxio-daemon.yml ``` ### Example Nginx application The `/examples` folder contains `PersistentVolume`, `PersistentVolumeClaim` and an nginx `Pod` mounting the alluxio volume under `/data`. You will need to update the alluxio `MASTER_HOST_NAME` and the share information under `volumeAttributes` in `alluxio-pv.yaml` file to match your alluxio master configuration. Run following commands to create nginx pod mounted with alluxio volume: ```bash kubectl apply -f alluxio-pv.yml kubectl apply -f alluxio-pvc.yml kubectl apply -f nginx.yml ``` pr-link: Alluxio#13435 change-id: cid-9f2d2c1b6723421861822388c73fb41e88a10e94
What changes are proposed in this pull request?
This PR integrates Alluxio CSI from community maintained repo (https://github.com/Alluxio/alluxio-csi) to main repo, with further improvement
Why are the changes needed?
Original CSI repo is not as well curated and managed as the main repo.
Given we have more
Does this PR introduce any user facing changes?
Yes, see the following example
Deploy
Go to
deploy
folder, Run following commands:Example Nginx application
The
/examples
folder containsPersistentVolume
,PersistentVolumeClaim
and an nginxPod
mounting the alluxio volume under/data
.You will need to update the alluxio
MASTER_HOST_NAME
and the share information undervolumeAttributes
inalluxio-pv.yaml
file to match your alluxio master configuration.Run following commands to create nginx pod mounted with alluxio volume: