Skip to content
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

Introduce Controller with Create and Delete Volume capability. Adds support for Dynamic Provisioning via access points #274

Merged
merged 1 commit into from
Jan 5, 2021

Conversation

kbasv
Copy link

@kbasv kbasv commented Nov 1, 2020

Is this a bug fix or adding new feature?
New Feature

What is this PR about? / Why do we need it?

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: efs-sc
provisioner: efs.csi.aws.com
parameters:
  provisioningMode: efs-ap
  fileSystemId: fs-01234567
  gidRangeStart: "1000"  //Optional
  gidRangeEnd: "2000"   //Optional
  directoryPerms: "777"
  basePath: "/data"  //Optional
  • Adds an opt-in flag to delete access virtual point directory and it's contents. By default, deleting a access point will not delete its virtual root directory or its content.

What testing is done?

  • Tested Manually on my EKS cluster.
  • E2E integration test for dynamic provisioning

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 1, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @kbasv. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 1, 2020
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Nov 1, 2020
@wongma7
Copy link
Contributor

wongma7 commented Nov 2, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 2, 2020
@kbasv kbasv force-pushed the controller branch 3 times, most recently from d7e43c8 to 22ccd19 Compare November 3, 2020 06:00
pkg/driver/node.go Outdated Show resolved Hide resolved
Copy link
Contributor

@chrishenzie chrishenzie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your work on this! One other nit: Can you run goimports on the files you modified here?

go get golang.org/x/tools/cmd/goimports
find . -name \*.go -not -path './vendor/*' -exec goimports -w {} \;

Makefile Outdated Show resolved Hide resolved
pkg/cloud/cloud.go Show resolved Hide resolved
pkg/cloud/cloud.go Outdated Show resolved Hide resolved
pkg/cloud/cloud.go Outdated Show resolved Hide resolved
pkg/cloud/cloud.go Show resolved Hide resolved
pkg/cloud/fakes.go Show resolved Hide resolved
pkg/driver/controller.go Show resolved Hide resolved
pkg/driver/controller.go Outdated Show resolved Hide resolved
pkg/driver/controller.go Outdated Show resolved Hide resolved
pkg/driver/node.go Outdated Show resolved Hide resolved
pkg/driver/efs_watch_dog.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 4, 2020
Copy link
Contributor

@jqmichael jqmichael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you are working on e2e tests at least for the happy path?

deploy/kubernetes/base/clusterrole-provisioner.yaml Outdated Show resolved Hide resolved
deploy/kubernetes/base/controller.yaml Show resolved Hide resolved
deploy/kubernetes/base/controller.yaml Outdated Show resolved Hide resolved
pkg/cloud/cloud.go Outdated Show resolved Hide resolved
pkg/driver/controller.go Outdated Show resolved Hide resolved
pkg/driver/controller.go Outdated Show resolved Hide resolved
pkg/driver/node.go Show resolved Hide resolved
pkg/driver/node.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 7, 2020
@kbasv kbasv force-pushed the controller branch 3 times, most recently from a00050c to 4faa95e Compare November 10, 2020 14:40
Comment on lines 229 to 243
//Mount File System at it root and delete access point root directory
mountOptions := []string{"tls"}
target := TempMountPathPrefix + "/" + accessPointId
if err := d.mounter.MakeDir(target); err != nil {
return nil, status.Errorf(codes.Internal, "Could not create dir %q: %v", target, err)
}
if err := d.mounter.Mount(fileSystemId, target, "efs", mountOptions); err != nil {
os.Remove(target)
return nil, status.Errorf(codes.Internal, "Could not mount %q at %q: %v", fileSystemId, target, err)
}
os.RemoveAll(target + accessPoint.AccessPointRootDir)
err = d.mounter.Unmount(target)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is saying on an arbitrary node (where the controller pod is assigned with), mount the EFS volume, delete the content, and unmount after.

I think this is OK but would like @wongma7 to double check.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks OK to me as long as the behavior is behind a flag and well documented.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO deleteAccessPointRootDir should default true to match kubernetes expectations where Delete means data is gone.

@k8s-ci-robot k8s-ci-robot merged commit aad2f30 into kubernetes-sigs:master Jan 5, 2021
Copy link
Contributor

@jqmichael jqmichael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we update example how to run dynamic provisioning with efs driver?

@@ -102,6 +103,26 @@ func (e *efsDriver) GetPersistentVolumeSource(readOnly bool, fsType string, volu
return &pvSource, nil
}

func (e *efsDriver) GetDynamicProvisionStorageClass(config *testsuites.PerTestConfig, fsType string) *storagev1.StorageClass {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is implementing GetDynamicProvisionStorageClass how to enable upstream dynamic provision tests?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this allows the test suites to detect and run dynamic provision tests

@kbasv
Copy link
Author

kbasv commented Jan 5, 2021

@jqmichael I will be creating adding examples and documentation in a follow up PR

@wangycc
Copy link

wangycc commented Jan 6, 2021

kubectl apply -f serviceaccount-csi-controller.yaml node.yaml csidriver.yaml controller.yaml clusterrole-provisioner.yaml clusterrolebinding-provisioner.yaml

After all apply, the controller component fails to start

controller logs:

I0106 03:02:23.058741       1 connection.go:186] GRPC error: rpc error: code = Unimplemented desc = unknown service csi.v1.Controller
F0106 03:02:23.058758       1 csi-provisioner.go:188] Error getting CSI driver capabilities: rpc error: code = Unimplemented desc = unknown service csi.v1.Controller

@wongma7
Copy link
Contributor

wongma7 commented Jan 6, 2021

@wangycc what is the image in the controller.yaml? it should be amazon/aws-efs-csi-driver:master since no release contains this commit yet

@wangycc
Copy link

wangycc commented Jan 6, 2021

@wongma7 amazon/aws-efs-csi-driver:latest,When do you plan to push the controller image? We started to try.

This was referenced Jan 6, 2021
@kbasv kbasv deleted the controller branch January 7, 2021 23:07
gazal-k added a commit to gazal-k/aws-efs-csi-driver that referenced this pull request Jan 10, 2021
Most application charts don't usually create `StorageClass`es. They create PVCs. This is extending the work done in kubernetes-sigs#274. The chart itself is kind of broken unless `image.tag` is set to "master". kubernetes-sigs#291 will probably address that.
gazal-k added a commit to gazal-k/aws-efs-csi-driver that referenced this pull request Jan 10, 2021
Most application charts don't usually create `StorageClass`es. They create PVCs. This is extending the work done in kubernetes-sigs#274. The chart itself is kind of broken unless `image.tag` is set to "master". kubernetes-sigs#291 will probably address that.
gazal-k added a commit to gazal-k/aws-efs-csi-driver that referenced this pull request Jan 10, 2021
Most application charts don't usually create `StorageClass`es. They create PVCs. This is extending the work done in kubernetes-sigs#274. The chart itself is kind of broken unless `image.tag` is set to "master". kubernetes-sigs#291 will probably address that.
gazal-k added a commit to gazal-k/aws-efs-csi-driver that referenced this pull request Jan 15, 2021
Most application charts don't usually create `StorageClass`es. They create PVCs. This is extending the work done in kubernetes-sigs#274. The chart itself is kind of broken unless `image.tag` is set to "master". kubernetes-sigs#291 will probably address that.
gazal-k added a commit to gazal-k/aws-efs-csi-driver that referenced this pull request Feb 8, 2021
Most application charts don't usually create `StorageClass`es. They create PVCs. This is extending the work done in kubernetes-sigs#274. The chart itself is kind of broken unless `image.tag` is set to "master". kubernetes-sigs#291 will probably address that.
@Skaronator
Copy link

I'm a bit confused. This is not part of the 1.1 release, right? Will there be a new release any time soon?

@wongma7
Copy link
Contributor

wongma7 commented Mar 1, 2021

@Skaronator right, this was merged into master branch but excluded from 1.1 release. I don't have ETA for when this will be released

@Eternal21
Copy link

I'm following the link to this issue from this document. Is it now part of the official release?

@rnishtala-sumo
Copy link

it would help to have an update on when support for dynamic provisioning will be released. Creating multiple accesspoints/PVs manually seems like a large overhead.

@ncgisudo
Copy link

ncgisudo commented Dec 5, 2022

Is this actually available? The feature was merged in Jan 2021 and it's now December 2022 (23 months later) and there's no information about it.

@amej
Copy link

amej commented Feb 21, 2023

Is this actually available? The feature was merged in Jan 2021 and it's now December 2022 (23 months later) and there's no information about it.

As a customer of this efs csi driver, I confirm that Dynamic provisioning via access point is available. Delete volume capability does not fully work as mentioned in the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto creation of Accesspoints Implement dynamic provision support