Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: add enableVolumeMountGroup feature flag #1236

Merged
merged 2 commits into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | `` |
Expand Down
Binary file modified charts/latest/azurefile-csi-driver-v0.0.0.tgz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ spec:
volumeLifecycleModes:
- Persistent
- Ephemeral
fsGroupPolicy: ReadWriteOnceWithFSType
fsGroupPolicy: {{ .Values.feature.fsGroupPolicy }}
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
2 changes: 2 additions & 0 deletions charts/latest/azurefile-csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ snapshot:

feature:
enableGetVolumeStats: true
enableVolumeMountGroup: true
fsGroupPolicy: ReadWriteOnceWithFSType

driver:
name: file.csi.azure.com
Expand Down
8 changes: 6 additions & 2 deletions pkg/azurefile/azurefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ type DriverOptions struct {
AllowEmptyCloudConfig bool
AllowInlineVolumeKeyAccessWithIdentity bool
EnableVHDDiskFeature bool
EnableVolumeMountGroup bool
EnableGetVolumeStats bool
AppendMountErrorHelpLink bool
MountPermissions uint64
Expand All @@ -214,6 +215,7 @@ type Driver struct {
allowInlineVolumeKeyAccessWithIdentity bool
enableVHDDiskFeature bool
enableGetVolumeStats bool
enableVolumeMountGroup bool
appendMountErrorHelpLink bool
mountPermissions uint64
kubeAPIQPS float64
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
})
Expand All @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions pkg/azurefileplugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -88,6 +89,7 @@ func handle() {
CustomUserAgent: *customUserAgent,
UserAgentSuffix: *userAgentSuffix,
AllowEmptyCloudConfig: *allowEmptyCloudConfig,
EnableVolumeMountGroup: *enableVolumeMountGroup,
EnableGetVolumeStats: *enableGetVolumeStats,
MountPermissions: *mountPermissions,
AllowInlineVolumeKeyAccessWithIdentity: *allowInlineVolumeKeyAccessWithIdentity,
Expand Down