You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kubectl exec -it security-context-demo -- sh -c "ls -l /data/demo/testfile"
149
+
```
150
+
151
+
The output you would expect is that the `/data/demo/testfile` file has group ID 2000, which is the value of fsGroup
152
+
```bash
153
+
-rw-r--r-- 1 root 2000 6 Jun 6 20:08 testfile
154
+
```
155
+
156
+
But the same does not reflect on your volume, i.e. the permissions on your files/folders are not what you would expect.
157
+
Ex:
158
+
```bash
159
+
-rw-r--r-- 1 root root 6 Jun 6 20:08 testfile
160
+
```
161
+
162
+
### Solution:
163
+
Create a CSI Driver object with spec: `fsGroupPolicy: File`.
164
+
Ex:
165
+
```yaml
166
+
apiVersion: storage.k8s.io/v1
167
+
kind: CSIDriver
168
+
metadata:
169
+
name: blockvolume.csi.oraclecloud.com
170
+
spec:
171
+
fsGroupPolicy: File
172
+
```
173
+
`File` - Indicates that the CSI volume driver supports volume ownership and permission change via fsGroup, and Kubernetes may use fsGroup to change permissions and ownership of the volume to match user requested fsGroup in the pod's SecurityPolicy regardless of fstype or access mode.
0 commit comments