Skip to content

Commit ee2ee0b

Browse files
authored
Merge pull request #1740 from dankova22/release-2.1.15
Release 2.1.15
2 parents 970efdc + c37c042 commit ee2ee0b

File tree

25 files changed

+820
-53
lines changed

25 files changed

+820
-53
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ RUN mkdir -p /tmp/rpms && \
3838
then echo "Installing efs-utils from Amazon Linux 2 yum repo" && \
3939
yum -y install --downloadonly --downloaddir=/tmp/rpms amazon-efs-utils-1.35.0-1.amzn2.noarch; \
4040
else echo "Installing efs-utils from github using the latest git tag" && \
41-
yum -y install systemd git rpm-build make openssl-devel curl && \
41+
yum -y install systemd git rpm-build make openssl-devel curl golang cmake && \
4242
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
4343
source $HOME/.cargo/env && \
4444
rustup update && \

OWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ approvers:
1111
- Ashley-wenyizha
1212
- mskanth972
1313
- seanzatzdev-amazon
14+
- dankova22
15+
- DavidXU12345

charts/aws-efs-csi-driver/templates/controller-serviceaccount.yaml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,33 @@ subjects:
8585
roleRef:
8686
kind: ClusterRole
8787
name: efs-csi-external-provisioner-role-describe-secrets
88-
apiGroup: rbac.authorization.k8s.io
88+
apiGroup: rbac.authorization.k8s.io
89+
{{- if .Values.controller.fileSystemIdRefs.enabled }}
90+
---
91+
# Permissions needed for pulling file system id
92+
kind: ClusterRole
93+
apiVersion: rbac.authorization.k8s.io/v1
94+
metadata:
95+
name: efs-csi-filesystem-id-reader-role
96+
labels:
97+
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
98+
rules:
99+
- apiGroups: [""]
100+
resources: ["configmaps", "secrets"]
101+
verbs: ["get"]
102+
---
103+
kind: ClusterRoleBinding
104+
apiVersion: rbac.authorization.k8s.io/v1
105+
metadata:
106+
name: efs-csi-filesystem-id-reader-role-binding
107+
labels:
108+
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
109+
subjects:
110+
- kind: ServiceAccount
111+
name: {{ .Values.controller.serviceAccount.name }}
112+
namespace: {{ .Release.Namespace }}
113+
roleRef:
114+
kind: ClusterRole
115+
name: efs-csi-filesystem-id-reader-role
116+
apiGroup: rbac.authorization.k8s.io
117+
{{- end }}

charts/aws-efs-csi-driver/templates/storageclass.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
name: {{ .name }}
66
{{- with .annotations }}
77
annotations:
8-
{{ toYaml . | indent 4 }}
8+
{{- toYaml . | nindent 4 }}
99
{{- end }}
1010
provisioner: efs.csi.aws.com
1111
{{- with .mountOptions }}

charts/aws-efs-csi-driver/values.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ controller:
136136
# topologyKey: kubernetes.io/hostname
137137
# whenUnsatisfiable: ScheduleAnyway
138138
topologySpreadConstraints: []
139+
# Enable reading filesystem IDs from configmap/secret
140+
fileSystemIdRefs:
141+
enabled: false
139142

140143
## Node daemonset variables
141144

@@ -219,8 +222,6 @@ storageClasses: []
219222
# annotations:
220223
# # Use that annotation if you want this to your default storageclass
221224
# storageclass.kubernetes.io/is-default-class: "true"
222-
# mountOptions:
223-
# - tls
224225
# parameters:
225226
# provisioningMode: efs-ap
226227
# fileSystemId: fs-1122aabb

cmd/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ func main() {
4747
maxInflightMountCalls = flag.Int64("max-inflight-mount-calls", driver.UnsetMaxInflightMountCounts, "New NodePublishVolume operation will be blocked if maximum number of inflight calls is reached. If maxInflightMountCallsOptIn is true, it has to be set to a positive value.")
4848
volumeAttachLimitOptIn = flag.Bool("volume-attach-limit-opt-in", false, "Opt in to use volume attach limit.")
4949
volumeAttachLimit = flag.Int64("volume-attach-limit", driver.UnsetVolumeAttachLimit, "Maximum number of volumes that can be attached to a node. If volumeAttachLimitOptIn is true, it has to be set to a positive value.")
50+
forceUnmountAfterTimeout = flag.Bool("force-unmount-after-timeout", false, "Enable force unmount if normal unmount times out during NodeUnpublishVolume.")
51+
unmountTimeout = flag.Duration("unmount-timeout", driver.DefaultUnmountTimeout, "Timeout for unmounting a volume during NodePublishVolume when forceUnmountAfterTimeout is true. If the timeout is reached, the volume will be forcibly unmounted. The default value is 30 seconds.")
5052
)
5153
klog.InitFlags(nil)
5254
flag.Parse()
@@ -65,7 +67,7 @@ func main() {
6567
if err != nil {
6668
klog.Fatalln(err)
6769
}
68-
drv := driver.NewDriver(*endpoint, etcAmazonEfs, *efsUtilsStaticFilesPath, *tags, *volMetricsOptIn, *volMetricsRefreshPeriod, *volMetricsFsRateLimit, *deleteAccessPointRootDir, *adaptiveRetryMode, *maxInflightMountCallsOptIn, *maxInflightMountCalls, *volumeAttachLimitOptIn, *volumeAttachLimit)
70+
drv := driver.NewDriver(*endpoint, etcAmazonEfs, *efsUtilsStaticFilesPath, *tags, *volMetricsOptIn, *volMetricsRefreshPeriod, *volMetricsFsRateLimit, *deleteAccessPointRootDir, *adaptiveRetryMode, *maxInflightMountCallsOptIn, *maxInflightMountCalls, *volumeAttachLimitOptIn, *volumeAttachLimit, *forceUnmountAfterTimeout, *unmountTimeout)
6971
if err := drv.Run(); err != nil {
7072
klog.Fatalln(err)
7173
}

deploy/kubernetes/base/node-daemonset.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ spec:
6161
- --max-inflight-mount-calls=10
6262
- --volume-attach-limit-opt-in=false
6363
- --volume-attach-limit=20
64+
- --force-unmount-after-timeout=false
65+
- --unmount-timeout=30s
6466
env:
6567
- name: CSI_ENDPOINT
6668
value: unix:/csi/csi.sock

docs/README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ The following CSI interfaces are implemented:
2828
| Parameters | Values | Default | Optional | Description |
2929
|-----------------------|--------|-----------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
3030
| provisioningMode | efs-ap | | false | Type of volume provisioned by efs. Currently, Access Points are supported. |
31-
| fileSystemId | | | false | File System under which access points are created. |
31+
| fileSystemId | | | true* | File System under which access points are created. See footnote for usage details. |
32+
| fileSystemIdConfigRef | | | true* | Reference to a ConfigMap containing the filesystem ID in format `namespace/name/key`. See footnote for usage details. |
33+
| fileSystemIdSecretRef | | | true* | Reference to a Secret containing the filesystem ID in format `namespace/name/key`. See footnote for usage details. |
3234
| directoryPerms | | | false | Directory permissions for [Access Point root directory](https://docs.aws.amazon.com/efs/latest/ug/efs-access-points.html#enforce-root-directory-access-point) creation. |
3335
| uid | | | true | POSIX user Id to be applied for [Access Point root directory](https://docs.aws.amazon.com/efs/latest/ug/efs-access-points.html#enforce-root-directory-access-point) creation. |
3436
| gid | | | true | POSIX group Id to be applied for [Access Point root directory](https://docs.aws.amazon.com/efs/latest/ug/efs-access-points.html#enforce-root-directory-access-point) creation. |
@@ -38,9 +40,10 @@ The following CSI interfaces are implemented:
3840
| 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` |
3941
| 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. |
4042
| 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 |
41-
| reuseAccessPoint | | false | true | When set to true, it creates the Access Point client-token from the provided PVC name. So that the AccessPoint can be replicated from a different cluster if same PVC name and storageclass configuration are used. |
43+
| reuseAccessPoint | | false | true | When set to true, it creates the Access Point client-token from the provided PVC name. So that the AccessPoint can be replicated from a different cluster if same PVC name and storageclass configuration are used. This feature is currently only supported for a single filesystem per account/region. If attempting to reuse access points across multiple clusters and filesystems within the same region, volume provisioning will fail. If you wish to use the same EFS accesspoint across different clusters for multiple filesystems in a single region, we recommend manually creating the access points and [statically provisioning](https://github.com/kubernetes-sigs/aws-efs-csi-driver/tree/master/examples/kubernetes/access_points) those volumes. |
4244

4345
**Note**
46+
* **Filesystem ID Source (marked with \*)**: Exactly one of `fileSystemId`, `fileSystemIdConfigRef`, or `fileSystemIdSecretRef` must be specified to provide the EFS filesystem ID. For detailed usage guide, see the [ConfigMap and Secret Resolution Guide](./filesystem-id-resolution.md).
4447
* Custom Posix group Id range for Access Point root directory must include both `gidRangeStart` and `gidRangeEnd` parameters. These parameters are optional only if both are omitted. If you specify one, the other becomes mandatory.
4548
* When using a custom Posix group ID range, there is a possibility for the driver to run out of available POSIX group Ids. We suggest ensuring custom group ID range is large enough or create a new storage class with a new file system to provision additional volumes.
4649
* `az` under storage class parameter is not be confused with efs-utils mount option `az`. The `az` mount option is used for cross-az mount or efs one zone file system mount within the same aws account as the cluster.
@@ -49,6 +52,7 @@ The following CSI interfaces are implemented:
4952
* The uid/gid configured on the access point is either the uid/gid specified in the storage class, a value in the gidRangeStart-gidRangeEnd (used as both uid/gid) specified in the storage class, or is a value selected by the driver is no uid/gid or gidRange is specified.
5053
* We suggest using [static provisioning](https://github.com/kubernetes-sigs/aws-efs-csi-driver/blob/master/examples/kubernetes/static_provisioning/README.md) if you do not wish to use user identity enforcement.
5154

55+
---
5256
If you want to pass any other mountOptions to Amazon EFS CSI driver while mounting, they can be passed in through the Persistent Volume or the Storage Class objects, depending on whether static or dynamic provisioning is used. The following are examples of some mountOptions that can be passed:
5357
* **lookupcache**: Specifies how the kernel manages its cache of directory entries for a given mount point. Mode can be one of all, none, pos, or positive. Each mode has different functions and for more information you can refer to this [link](https://linux.die.net/man/5/nfs).
5458
* **iam**: Use the CSI Node Pod's IAM identity to authenticate with Amazon EFS.
@@ -171,7 +175,7 @@ You can find previous efs-csi-driver versions' images from [here](https://galler
171175

172176
### Features
173177
* Static provisioning - Amazon EFS file system needs to be created manually first, then it could be mounted inside container as a persistent volume (PV) using the driver.
174-
* Dynamic provisioning - Uses a persistent volume claim (PVC) to dynamically provision a persistent volume (PV). On Creating a PVC, kuberenetes requests Amazon EFS to create an Access Point in a file system which will be used to mount the PV.
178+
* Dynamic provisioning - Uses a persistent volume claim (PVC) to dynamically provision a persistent volume (PV). On Creating a PVC, Kubernetes requests Amazon EFS to create an Access Point in a file system which will be used to mount the PV.
175179
* Mount Options - Mount options can be specified in the persistent volume (PV) or storage class for dynamic provisioning to define how the volume should be mounted.
176180
* Encryption of data in transit - Amazon EFS file systems are mounted with encryption in transit enabled by default in the master branch version of the driver.
177181
* Cross account mount - Amazon EFS file systems from different aws accounts can be mounted from an Amazon EKS cluster.
@@ -359,6 +363,11 @@ After deploying the driver, you can continue to these sections:
359363
| max-inflight-mount-calls | | -1 | true | New NodePublishVolume operation will be blocked if maximum number of inflight calls is reached. If maxInflightMountCallsOptIn is true, it has to be set to a positive value. |
360364
| volume-attach-limit-opt-in | | false | true | Opt in to use volume attach limit. |
361365
| volume-attach-limit | | -1 | true | Maximum number of volumes that can be attached to a node. If volumeAttachLimitOptIn is true, it has to be set to a positive value. |
366+
| force-unmount-after-timeout | | false | true | Enable force unmount if normal unmount times out during NodeUnpublishVolume |
367+
| unmount-timeout | | 30s | true | Timeout for unmounting a volume during NodePublishVolume when forceUnmountAfterTimeout is true. If the timeout is reached, the volume will be forcibly unmounted. The default value is 30 seconds. |
368+
369+
#### Force Unmount After Timeout
370+
The `force-unmount-after-timeout` feature addresses issues when `NodeUnpublishVolume` gets called infinite times and hangs indefinitely due to broken NFS connections. When enabled, if a normal unmount operation exceeds the configured timeout, the driver will forcibly unmount the volume to prevent indefinite hanging and allow the operation to complete.
362371

363372
#### Suggestion for setting max-inflight-mount-calls and volume-attach-limit
364373

docs/filesystem-id-resolution.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Dynamic Filesystem ID Resolution
2+
3+
The EFS CSI driver supports dynamic filesystem ID resolution from Kubernetes ConfigMaps and Secrets. This enables workflows where tools provision EFS filesystems and write the filesystem ID to Kubernetes resources, which the CSI driver reads automatically during volume provisioning.
4+
5+
**Reference Format:** `namespace/name/key`
6+
7+
**Parameter Requirements:** Exactly one of `fileSystemId`, `fileSystemIdConfigRef`, or `fileSystemIdSecretRef` must be specified in StorageClass parameters.
8+
9+
**Example with ConfigMap:**
10+
```yaml
11+
# ConfigMap created
12+
apiVersion: v1
13+
kind: ConfigMap
14+
metadata:
15+
name: efs-config
16+
namespace: kube-system
17+
data:
18+
fileSystemId: fs-02604354c13d0316d
19+
---
20+
# StorageClass references the ConfigMap
21+
kind: StorageClass
22+
apiVersion: storage.k8s.io/v1
23+
metadata:
24+
name: efs-sc
25+
provisioner: efs.csi.aws.com
26+
parameters:
27+
provisioningMode: efs-ap
28+
fileSystemIdConfigRef: "kube-system/efs-config/fileSystemId"
29+
directoryPerms: "700"
30+
```
31+
32+
**Enabling RBAC Permissions (Required):**
33+
34+
This feature requires additional RBAC permissions for the controller service account to read ConfigMaps and Secrets. When installing via Helm, enable with:
35+
```bash
36+
helm install aws-efs-csi-driver ./charts/aws-efs-csi-driver \
37+
--set controller.fileSystemIdRefs.enabled=true
38+
```
39+
40+
For static manifest installations, manually apply the RBAC resources from the Helm chart templates.

examples/kubernetes/access_points/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ Also you can verify that data is written into the EFS filesystems:
8484
```
8585
spec:
8686
mountOptions:
87-
- tls
8887
- accesspoint=fsap-068c22f0246419f75
8988
```
9089
as this could subject you to

0 commit comments

Comments
 (0)