diff --git a/deploy/charts/rook-ceph/values.yaml b/deploy/charts/rook-ceph/values.yaml index 77e28f0d7..4d75ad5ea 100644 --- a/deploy/charts/rook-ceph/values.yaml +++ b/deploy/charts/rook-ceph/values.yaml @@ -85,7 +85,7 @@ csi: # (Optional) policy for modifying a volume's ownership or permissions when the CephFS PVC is being mounted. # supported values are documented at https://kubernetes-csi.github.io/docs/support-fsgroup.html - cephFSFSGroupPolicy: "ReadWriteOnceWithFSType" + cephFSFSGroupPolicy: "File" # (Optional) policy for modifying a volume's ownership or permissions when the NFS PVC is being mounted. # supported values are documented at https://kubernetes-csi.github.io/docs/support-fsgroup.html diff --git a/deploy/examples/operator-openshift.yaml b/deploy/examples/operator-openshift.yaml index 2f8678c2e..2c9322e90 100644 --- a/deploy/examples/operator-openshift.yaml +++ b/deploy/examples/operator-openshift.yaml @@ -162,7 +162,7 @@ data: # (Optional) policy for modifying a volume's ownership or permissions when the CephFS PVC is being mounted. # supported values are documented at https://kubernetes-csi.github.io/docs/support-fsgroup.html - CSI_CEPHFS_FSGROUPPOLICY: "ReadWriteOnceWithFSType" + CSI_CEPHFS_FSGROUPPOLICY: "File" # (Optional) policy for modifying a volume's ownership or permissions when the NFS PVC is being mounted. # supported values are documented at https://kubernetes-csi.github.io/docs/support-fsgroup.html diff --git a/deploy/examples/operator.yaml b/deploy/examples/operator.yaml index e1a6a67ab..c0abcc9a5 100644 --- a/deploy/examples/operator.yaml +++ b/deploy/examples/operator.yaml @@ -77,7 +77,7 @@ data: # (Optional) policy for modifying a volume's ownership or permissions when the CephFS PVC is being mounted. # supported values are documented at https://kubernetes-csi.github.io/docs/support-fsgroup.html - CSI_CEPHFS_FSGROUPPOLICY: "ReadWriteOnceWithFSType" + CSI_CEPHFS_FSGROUPPOLICY: "File" # (Optional) policy for modifying a volume's ownership or permissions when the NFS PVC is being mounted. # supported values are documented at https://kubernetes-csi.github.io/docs/support-fsgroup.html diff --git a/pkg/operator/ceph/csi/betav1csidriver.go b/pkg/operator/ceph/csi/betav1csidriver.go index efbf4c77f..cf7b487b8 100644 --- a/pkg/operator/ceph/csi/betav1csidriver.go +++ b/pkg/operator/ceph/csi/betav1csidriver.go @@ -52,6 +52,11 @@ func (d beta1CsiDriver) createCSIDriverInfo(ctx context.Context, clientset kuber }, } if fsGroupPolicy != "" { + if fsGroupPolicy == "File" { + // fsGroupPolicy: File was added in Kubernetes 1.19, considering beta1CsiDriver + // life exist before 1.19, we are falling back to `ReadWriteOnceWithFStype`. + fsGroupPolicy = "ReadWriteOnceWithFSType" + } policy := betav1k8scsi.FSGroupPolicy(fsGroupPolicy) csiDriver.Spec.FSGroupPolicy = &policy }