-
Notifications
You must be signed in to change notification settings - Fork 555
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
Reusing Access Points #1026
Reusing Access Points #1026
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mskanth972 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
d053824
to
effb068
Compare
fdcc1d3
to
f9993f6
Compare
/test pull-aws-efs-csi-driver-e2e |
/test pull-aws-efs-csi-driver-unit |
docs/README.md
Outdated
@@ -39,6 +39,8 @@ The following CSI interfaces are implemented: | |||
| subPathPattern | | `/${.PV.name}` | true | The template used to construct the subPath under which each of the access points created under Dynamic Provisioning. Can be made up of fixed strings and limited variables, is akin to the 'subPathPattern' variable on the [nfs-subdir-external-provisioner](https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner) chart. Supports `.PVC.name`,`.PVC.namespace` and `.PV.name` | | |||
| ensureUniqueDirectory | | true | true | **NOTE: Only set this to false if you're sure this is the behaviour you want**.<br/> Used when dynamic provisioning is enabled, if set to true, appends the a UID to the pattern specified in `subPathPattern` to ensure that access points will not accidentally point at the same directory. | | |||
| az | | "" | true | Used for cross-account mount. `az` under storage class parameter is optional. If specified, mount target associated with the az will be used for cross-account mount. If not specified, a random mount target will be picked for cross account mount | | |||
| ensureUniqueDirectory | | true | 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.
Why did we remove the explanation part of this param?
aws-efs-csi-driver/docs/README.md
Line 38 in 158d6f7
| ensureUniqueDirectory | | true | true | **NOTE: Only set this to false if you're sure this is the behaviour you want**.<br/> Used when dynamic provisioning is enabled, if set to true, appends the a UID to the pattern specified in `subPathPattern` to ensure that access points will not accidentally point at the same directory. | |
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 need to rebase this PR. I will do that and will push the changes
/lgtm |
Im struggling to implement this. i want to access the same EFS data across 2 clusters. The description above talks about using |
Sorry for the above example. We implemented that with a different parameter while testing and we changed to a new name that is reuseAccessPoint. Its totally upto the user in setting EnsureUniquedirectory parameter as it works either way. And will change the example mentioned above |
OK, so before i used this setting, I saw the Client token in efs with a value of like
|
sorry, i am seeing some logging similar to above.
so maybe i do have it working as expected. Also, i see you comment on the hashing function for the pvc name, so that must explain why im seeing a random string for the clientToken instead of my PVC name. |
@andrewhharmon , yes you are correct. It was the hashed character. |
Follow up question for you. So if we set the reclaim policy to Retain, if we delete the PVC, the PV will stay as well as the access point. But we could potentially end up with lots of unbound PVs. If we delete one of the PVs (bound or unbound), it will also delete the access point. But we may still have other PVs using that access point still. So we'd have a PV pointing to an access point that doesn't exist? Is there any advise on the best way to accomplish this? |
@mskanth972 @Ashley-wenyizha I am running into the similar issue as @andrewhharmon has pointed here. Are there any suggestions on handling this situation? |
Is this a bug fix or adding new feature?
When performing dynamic provisioning to mount Amazon Elastic File System (EFS) on an Elastic Kubernetes Service (EKS) cluster, an access point (folder) is automatically created within EFS. This access point is assigned a unique pathname based on the base path name /dynamic_provisioning/pvc-id, where the "pvc-id" represents a randomly generated Persistent Volume Claim (PVC) ID given by Kubernetes. The access point serves as the location where the actual data is stored.
However, a challenge arises when the EKS cluster experiences downtime, deleted accidentally or user wants to connect same AP for newly created EKS cluster. In such cases, when creating a new EKS cluster and performed dynamic provisioning a new access point is created with a different base pathname i.e., PVC ID. This poses an issue because the previous access point, which contains valuable data, becomes inaccessible from the pods as paths are mis-matching.
To overcome this challenge, a solution needs to be implemented to enable seamless data access and preservation across EKS cluster. The objective is to establish a mechanism that allows pods to access and manipulate data from the previous access point when user wants to.
To address the challenge of accessing previous access points in the EFS CSI driver during EKS cluster chnages, we propose the following approach.
First, we will leverage the client token feature provided by EFS, which serves as an idempotent identifier for access points. Additionally, we will introduce a new parameter in the storage class of the EFS CSI driver to enable this functionality.
To make the Access point re-usable user can set
reuseAccessPoint=true
parameter in Storageclass.yaml. When a new access point is created, we will assign the given PVC name as the client token. This establishes a connection between the PVC name and the access point, ensuring easy identification and matching. So, next time if the user wants to reconnect to existing AP from a different cluster, the same PVC name has to be mentioned.Now, let's consider the scenario where the user creates a new cluster. In this case, when a user wants to access the same old access point, they can simply provide the original PVC name during the mounting process. As the parameter is set to true in StorageClass, the EFS CSI driver will check for client tokens associated with the specific Elastic file system. If a matching client token is found for the provided PVC name, indicating the existence of an access point associated with that PVC name, the driver will recognize it as the same old access point. Instead of creating a new access point, it will reuse the existing one. This seamless transition ensures that users can access their old access points and the data within them.
Note: Client Token in Access point has a limit upto 64 char lengthIssue can occur when there are two PVCs with 64 + character length where first 64 characters are the same, So implemented hashing function to hash the names to < 64 char hash.
What is this PR about? / Why do we need it?
What testing is done?
Sample storage class
Logs