Skip to content

Conversation

@aliyajo
Copy link

@aliyajo aliyajo commented Oct 17, 2025

Is this a bug fix or adding new feature?

Adds a feature via #1615

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

Adds support for dynamically resolving filesystemId from K8 ConfigMaps and Secrets instead of having to manually copy the fileSystem Id.

Can reference ConfigMaps or Secrets containing FileSystemIDs, which the CSI driver will read automatically during provisioning.

New StorageClass parameters

  • fileSystemIdConfigRef: Reference to a ConfigMap
  • fileSystemIdSecretRef: Reference to a Secret

Reference Format: namespace/name/key

Example:

# ConfigMap created
apiVersion: v1
kind: ConfigMap
metadata:
  name: efs-config
  namespace: kube-system
data:
  fileSystemId: fs-02604354c13d0316d
---
# StorageClass references the ConfigMap
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: efs-sc
provisioner: efs.csi.aws.com
parameters:
  provisioningMode: efs-ap
  fileSystemIdConfigRef: "kube-system/efs-config/fileSystemId"
  directoryPerms: "700"

Features:

  • Opt-in security: RBAC only granted when controller.fileSystemIdRefs.enabled=true (default:false)
  • Support for both ConfigMaps and Secrets

What testing is done?

  • Unit testing
  • Integration Tests

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 17, 2025
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 17, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

Welcome @aliyajo!

It looks like this is your first PR to kubernetes-sigs/aws-efs-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-efs-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 k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 17, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @aliyajo. 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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 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 17, 2025
@aliyajo aliyajo changed the title Add ConfigMap/Secret filesystem ID references Specify fileSystemId from K8 ConfigMap/Secret Oct 17, 2025
@aliyajo aliyajo marked this pull request as ready for review October 17, 2025 17:45
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 17, 2025
Copy link
Contributor

@DavidXU12345 DavidXU12345 left a comment

Choose a reason for hiding this comment

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

lgtm, just leave some nit comments, up to you whether to do it in this PR or not

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 27, 2025
@DavidXU12345 DavidXU12345 self-requested a review October 27, 2025 16:18
Add support for dynamic filesystem ID resolution from ConfigMaps and Secrets.

Changes:
- Add fileSystemIdConfigRef and fileSystemIdSecretRef StorageClass parameters
- Add opt-in RBAC via controller.fileSystemIdRefs.enabled flag (default:false)
- Add permissions to grant access to configmaps and secret
- Improve error messages to detect RBAC issues and guide users to enable feature flag
Changes:
- Enforce that only one fileSystem ID source must be specified
- Update README documentation
- Improve error handling with structured reference parsing
- Update unit tests
- Seperated testing and main functionality for file id resolution
- Fixed code style for getFileSystemIdFromRef
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aliyajo, DavidXU12345

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@DavidXU12345
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 Oct 27, 2025
@DavidXU12345
Copy link
Contributor

/retest

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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants