diff --git a/Makefile b/Makefile index f48c3c0bce..797690a497 100755 --- a/Makefile +++ b/Makefile @@ -33,6 +33,9 @@ E2E_HELM_OPTIONS += ${EXTRA_HELM_OPTIONS} ifdef KUBERNETES_VERSION # disable kubelet-registration-probe on capz cluster testing E2E_HELM_OPTIONS += --set linux.enableRegistrationProbe=false --set windows.enableRegistrationProbe=false endif +ifdef EXTERNAL_E2E_TEST_NFS +E2E_HELM_OPTIONS += --set feature.enableVolumeMountGroup=false --set feature.fsGroupPolicy=File +endif GINKGO_FLAGS = -ginkgo.v GO111MODULE = on GOPATH ?= $(shell go env GOPATH) diff --git a/charts/README.md b/charts/README.md index fcaa9fa46a..090d4f4d74 100644 --- a/charts/README.md +++ b/charts/README.md @@ -52,6 +52,8 @@ The following table lists the configurable parameters of the latest Azure File C | `driver.userAgentSuffix` | userAgent suffix | `OSS-helm` | | `driver.azureGoSDKLogLevel` | [Azure go sdk log level](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/previous-versions-quickstart.md#built-in-basic-requestresponse-logging) | ``(no logs), `DEBUG`, `INFO`, `WARNING`, `ERROR`, [etc](https://github.com/Azure/go-autorest/blob/50e09bb39af124f28f29ba60efde3fa74a4fe93f/logger/logger.go#L65-L73). | | `feature.enableGetVolumeStats` | allow GET_VOLUME_STATS on agent node | `true` | +| `feature.enableVolumeMountGroup` | indicates whether enabling VOLUME_MOUNT_GROUP | `true` | +| `feature.fsGroupPolicy` | CSIDriver FSGroupPolicy value | `ReadWriteOnceWithFSType`(available values: `ReadWriteOnceWithFSType`, `File`, `None`) | | `image.baseRepo` | base repository of driver images | `mcr.microsoft.com` | | `image.azurefile.repository` | azurefile-csi-driver docker image | `/oss/kubernetes-csi/azurefile-csi` | | `image.azurefile.tag` | azurefile-csi-driver docker image tag | `` | diff --git a/charts/latest/azurefile-csi-driver-v0.0.0.tgz b/charts/latest/azurefile-csi-driver-v0.0.0.tgz index 4e02cb8ad3..99f20d98a2 100644 Binary files a/charts/latest/azurefile-csi-driver-v0.0.0.tgz and b/charts/latest/azurefile-csi-driver-v0.0.0.tgz differ diff --git a/charts/latest/azurefile-csi-driver/templates/csi-azurefile-driver.yaml b/charts/latest/azurefile-csi-driver/templates/csi-azurefile-driver.yaml index e1facb056a..8b715aee64 100644 --- a/charts/latest/azurefile-csi-driver/templates/csi-azurefile-driver.yaml +++ b/charts/latest/azurefile-csi-driver/templates/csi-azurefile-driver.yaml @@ -14,4 +14,4 @@ spec: volumeLifecycleModes: - Persistent - Ephemeral - fsGroupPolicy: ReadWriteOnceWithFSType + fsGroupPolicy: {{ .Values.feature.fsGroupPolicy }} diff --git a/charts/latest/azurefile-csi-driver/templates/csi-azurefile-node.yaml b/charts/latest/azurefile-csi-driver/templates/csi-azurefile-node.yaml index 06571312e2..52e5274d3e 100644 --- a/charts/latest/azurefile-csi-driver/templates/csi-azurefile-node.yaml +++ b/charts/latest/azurefile-csi-driver/templates/csi-azurefile-node.yaml @@ -131,6 +131,7 @@ spec: - "--custom-user-agent={{ .Values.driver.customUserAgent }}" - "--user-agent-suffix={{ .Values.driver.userAgentSuffix }}" - "--allow-empty-cloud-config={{ .Values.node.allowEmptyCloudConfig }}" + - "--enable-volume-mount-group={{ .Values.feature.enableVolumeMountGroup }}" - "--enable-get-volume-stats={{ .Values.feature.enableGetVolumeStats }}" - "--mount-permissions={{ .Values.linux.mountPermissions }}" - "--allow-inline-volume-key-access-with-identity={{ .Values.node.allowInlineVolumeKeyAccessWithIdentity }}" diff --git a/charts/latest/azurefile-csi-driver/values.yaml b/charts/latest/azurefile-csi-driver/values.yaml index 757006ab83..dd10442b12 100644 --- a/charts/latest/azurefile-csi-driver/values.yaml +++ b/charts/latest/azurefile-csi-driver/values.yaml @@ -156,6 +156,8 @@ snapshot: feature: enableGetVolumeStats: true + enableVolumeMountGroup: true + fsGroupPolicy: ReadWriteOnceWithFSType driver: name: file.csi.azure.com diff --git a/pkg/azurefile/azurefile.go b/pkg/azurefile/azurefile.go index 080636fc83..55ff37cc82 100644 --- a/pkg/azurefile/azurefile.go +++ b/pkg/azurefile/azurefile.go @@ -192,6 +192,7 @@ type DriverOptions struct { AllowEmptyCloudConfig bool AllowInlineVolumeKeyAccessWithIdentity bool EnableVHDDiskFeature bool + EnableVolumeMountGroup bool EnableGetVolumeStats bool AppendMountErrorHelpLink bool MountPermissions uint64 @@ -214,6 +215,7 @@ type Driver struct { allowInlineVolumeKeyAccessWithIdentity bool enableVHDDiskFeature bool enableGetVolumeStats bool + enableVolumeMountGroup bool appendMountErrorHelpLink bool mountPermissions uint64 kubeAPIQPS float64 @@ -258,6 +260,7 @@ func NewDriver(options *DriverOptions) *Driver { driver.allowEmptyCloudConfig = options.AllowEmptyCloudConfig driver.allowInlineVolumeKeyAccessWithIdentity = options.AllowInlineVolumeKeyAccessWithIdentity driver.enableVHDDiskFeature = options.EnableVHDDiskFeature + driver.enableVolumeMountGroup = options.EnableVolumeMountGroup driver.enableGetVolumeStats = options.EnableGetVolumeStats driver.appendMountErrorHelpLink = options.AppendMountErrorHelpLink driver.mountPermissions = options.MountPermissions @@ -325,7 +328,6 @@ func (d *Driver) Run(endpoint, kubeconfig string, testBool bool) { csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME, csi.ControllerServiceCapability_RPC_PUBLISH_UNPUBLISH_VOLUME, csi.ControllerServiceCapability_RPC_CREATE_DELETE_SNAPSHOT, - //csi.ControllerServiceCapability_RPC_LIST_SNAPSHOTS, csi.ControllerServiceCapability_RPC_EXPAND_VOLUME, csi.ControllerServiceCapability_RPC_SINGLE_NODE_MULTI_WRITER, }) @@ -342,7 +344,9 @@ func (d *Driver) Run(endpoint, kubeconfig string, testBool bool) { nodeCap := []csi.NodeServiceCapability_RPC_Type{ csi.NodeServiceCapability_RPC_STAGE_UNSTAGE_VOLUME, csi.NodeServiceCapability_RPC_SINGLE_NODE_MULTI_WRITER, - csi.NodeServiceCapability_RPC_VOLUME_MOUNT_GROUP, + } + if d.enableVolumeMountGroup { + nodeCap = append(nodeCap, csi.NodeServiceCapability_RPC_VOLUME_MOUNT_GROUP) } if d.enableGetVolumeStats { nodeCap = append(nodeCap, csi.NodeServiceCapability_RPC_GET_VOLUME_STATS) diff --git a/pkg/azurefileplugin/main.go b/pkg/azurefileplugin/main.go index 27d31b4b82..5c43d73bc5 100644 --- a/pkg/azurefileplugin/main.go +++ b/pkg/azurefileplugin/main.go @@ -47,6 +47,7 @@ var ( customUserAgent = flag.String("custom-user-agent", "", "custom userAgent") userAgentSuffix = flag.String("user-agent-suffix", "", "userAgent suffix") allowEmptyCloudConfig = flag.Bool("allow-empty-cloud-config", true, "allow running driver without cloud config") + enableVolumeMountGroup = flag.Bool("enable-volume-mount-group", true, "indicates whether enabling VOLUME_MOUNT_GROUP") enableGetVolumeStats = flag.Bool("enable-get-volume-stats", true, "allow GET_VOLUME_STATS on agent node") mountPermissions = flag.Uint64("mount-permissions", 0777, "mounted folder permissions") allowInlineVolumeKeyAccessWithIdentity = flag.Bool("allow-inline-volume-key-access-with-identity", false, "allow accessing storage account key using cluster identity for inline volume") @@ -88,6 +89,7 @@ func handle() { CustomUserAgent: *customUserAgent, UserAgentSuffix: *userAgentSuffix, AllowEmptyCloudConfig: *allowEmptyCloudConfig, + EnableVolumeMountGroup: *enableVolumeMountGroup, EnableGetVolumeStats: *enableGetVolumeStats, MountPermissions: *mountPermissions, AllowInlineVolumeKeyAccessWithIdentity: *allowInlineVolumeKeyAccessWithIdentity,