I am using
volumeMountGroup := req.GetVolumeCapability().GetMount().GetVolumeMountGroup()
klog.V(2).Infof("-NodePublishVolume-: volumeMountGroup: %v",volumeMountGroup)
in my CSI NodePublishVolume method to access FSGroup mentioned in pod spec.
My Pod spec is as follows
kind: Pod
apiVersion: v1
metadata:
name: cos-csi-app-s3fs
spec:
containers:
- name: app-frontend
image: rabbitmq
imagePullPolicy: IfNotPresent
volumeMounts:
- mountPath: "/data"
name: cos-csi-volume
securityContext:
fsGroup: 2000
runAsGroup: 2000
runAsUser: 2000
volumes:
- name: cos-csi-volume
persistentVolumeClaim:
In the logs , empty value is printed.
I0321 08:42:05.845519 1 nodeserver.go:144] -NodePublishVolume-: volumeMountGroup:
I expected "2000". Have I missed something or is my understanding about the concept wrong. I have added necessary capability to driver
csi.NodeServiceCapability_RPC_VOLUME_MOUNT_GROUP,