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

Subdirectory provisioning #272

Closed

Conversation

KanchiShimono
Copy link

Is this a bug fix or adding new feature?

New feature.
Attempt to implement subdirectory provisioning requested in #247.

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

PR summary:

  • Add new dynamic provisioning mode (subdirectory provisioning) that creating subdirectory under existing FSx file system.
  • Add new voulme ID form for subdirectory provisiong to be able to delete subdirectory in DeleteVolume method.
  • Add new parameters (dnsname, mountname and basedir) of CreateVolumeRequest.
    • If dnsname was set, the volume is provisioned as subdirectory mode.
    • Subdirectory is created under the basedir.
    • basedir is mounted into controller plugin container to create subdirectory.
    • subdirectory is mounted into volume claimed container.
  • Add new volume context for NodePublishVolume/NodeUnPublishVolume.

Why do we need?:

  • It's useful for usecase that required hundreds GB storage from multiple pod. (Can share form multiple pod)
  • Fast provisiong. (No need to wait for creating new file system.)
  • Enable to mount subdirectory on static provisioning.

What testing is done?

Run unit test on my local machine by running make test.
Also deploy and check on my EKS cluster.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 26, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

Welcome @KanchiShimono!

It looks like this is your first PR to kubernetes-sigs/aws-fsx-csi-driver 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/aws-fsx-csi-driver has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @KanchiShimono. 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Oct 26, 2022
@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 18, 2022
@jacobwolfaws
Copy link
Contributor

Hi @KanchiShimono, can you resolve the merge conflicts + rebase the commits you made for readability purposes?

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 9, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: KanchiShimono
Once this PR has been reviewed and has the lgtm label, please assign jacobwolfaws for approval by writing /assign @jacobwolfaws in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jacobwolfaws
Copy link
Contributor

/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 Dec 9, 2022
Comment on lines +44 to +45
securityContext:
privileged: true
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this change affect subdirectory provisioning and why is it needed?

Comment on lines +34 to +35
securityContext:
privileged: true
Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -6,3 +6,4 @@ metadata:
name: fsx.csi.aws.com
spec:
attachRequired: false
fsGroupPolicy: ReadWriteOnceWithFSType
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on the documentation: https://kubernetes-csi.github.io/docs/support-fsgroup.html it seems like not specifying the fsGroupPolicy policy will default to ReadWriteOnceWithFSType. Is this change needed & could this have any impact on any usecases for csi driver?

@kibblerz
Copy link

kibblerz commented Jan 11, 2023

In theory, couldn't a subdirectory be mounted by simply mounting the PV, with a mountname like "mount/subfolder"? I don't have FSx running to test this myself

@jacobwolfaws
Copy link
Contributor

In theory, couldn't a subdirectory be mounted by simply mounting the PV, with a mountname like "mount/subfolder"? I don't have FSx running to test this myself

Hi @kibblerz, from my understanding you can mount a subdirectory like you suggested, but the idea behind this PR is being able to provision the subdirectory using the csi driver.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 12, 2023
@k8s-ci-robot
Copy link
Contributor

@KanchiShimono: PR needs rebase.

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.

}()

// Delete subDir (dnsname@tcp:/mountname/baseDir/subDir) under the tempMountPathPrefix/tempUUID
if err := os.RemoveAll(filepath.Join(target, fsxVolume.subDir)); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

subDir and baseDir may need validation for relative paths. what happens if I set subDir to nonsense like ../

mountname: [MountName]
# set the basedir and subdir if you wanted to mount subdir
Copy link
Contributor

Choose a reason for hiding this comment

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

in kubernetes the volumehandle must uniquely identify the volume. if you try to mount two PVC+PV on the same node and they have the same volumehandle but different volumeattributes.subdir, I don't think it works. this is why in EFS we removed the path volumeattribute and stuffed everything into the volumehandle like [FileSystemId]:[Path] instead. https://github.com/kubernetes/kubernetes/blob/497e0dfd33b180fcc3855aad794d87f0e429c82c/pkg/volume/csi/csi_plugin.go#L316

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 12, 2023
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle rotten
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 12, 2023
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. 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.

None yet

6 participants