forked from kubernetes-sigs/aws-efs-csi-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: enable support for single AP per SC #1
Open
portellaa
wants to merge
14
commits into
master
Choose a base branch
from
single-ap
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adding subPathPattern allows us to support more use cases than before because now users can specify a template they wish to be created when the access point is created. This template matches the form of the nfs-subdir-provioner which aids consistency. This defaults to /${.PV.name} to be in keeping with current behaviour but allows much more flexibility.
These functions allow us to take a pattern and turn it into a valid directory name. These can then be called in the method that builds up the directory name to be sent to the API.
Adds happy path testing for subPathPattern including whether it plays nicely with existing basePath parameter
Removing the 0-length check allows us to support not setting a basePath but having an empty pattern, as distinct from not setting subPathPattern, which means "/" can be used as a valid accessPoint path.
This ensures we can control when we want directories created under dynamic provisioning to be unique and when we don't (poweruser mode). This also adds some successful tests, next commit will add the failure cases to make sure all bases are covered.
Added a fix around the handling for misconfiguration of the ensureUniqueDirectory whereby if it's misconfigured it will fall through to its default value.
This has come up in several issues on the repo where people set basePath to `/` and this leads to problems. This proves this PR resolves that issue and doesn't lead to the problems of a path like `//`
renatoaguimaraes
suggested changes
Sep 15, 2022
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.
well done 🚀
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Is this a bug fix or adding new feature?
This PR is based on the work from @jonathanrainer in the PR kubernetes-sigs#640
What is this PR about? / Why do we need it?
The only change we did that fits our needs was add a new parameter to the storage class to allow the developer to specify a single AccessPoint that will be used through all the Volumes created by that StorageClass.
We suffer a lot with the 120 APs limitation, since we dynamically provision new resources based on user input or needs.
Also we don't run our workloads with root access, so we can't use the dir options also introduced in the PR kubernetes-sigs#732
Yes, we could create a static PV and use the PV across all the workloads, **and probably that's the best solution for most of the people), but giving the way we have our architecture, this wouldn't fit well.
What testing is done?
We are testing this yet, so far so good it seems to be working.
Probably this isn't the best option for the case, or something that most of the people will approve or thing as useful, but it fits our necessity.
We will think in a solution that we would that could fit most of the people that needs this, so far for us this makes sense, because each AP is limited to a UID/GID and you can create folder inside of it, for example, let's imagine users home directory, for multiple users:
AP 1, UID=1001, GID=1001
AP2, UID=1002, GID=1002
for example this works, of course you would need to specify a storage class per user and you are still limited to the 120 APs, but well, we are trying to get somewhere to "bypass" that limitation and still have permissions in the structure.