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
Copy file name to clipboardExpand all lines: AKS-Arc/concepts-storage.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,6 +111,24 @@ volumeMounts:
111
111
- mountPath: "c:\k"
112
112
name: k-dir
113
113
```
114
+
## Secure pod access to mounted volumes
115
+
116
+
For your applications to run correctly, pods should run as a defined user or group and not as *root*. The 'securityContext' for a pod or container lets you define settings such as *fsGroup* to assume the appropriate permissions on the mounted volumes.
117
+
*fsGroup* is a field within the 'securityContext' of a Kubernetes Pod specification. It defines a supplemental group ID that Kubernetes assigns to all processes in the Pod and recursively to the files in mounted volumes. This ensures that the Pod has the correct group-level access to shared storage volumes.
118
+
119
+
When a volume is mounted, Kubernetes changes the ownership of the volume's contents to match the *fsGroup* value. This is particularly useful when containers run as non-root users and need write access to shared volumes.
120
+
121
+
Example YAML snippet:
122
+
```yaml
123
+
124
+
securityContext:
125
+
fsGroup: 2000
126
+
127
+
```
128
+
In this example:
129
+
All files in mounted volumes are accessible by GID 2000.
0 commit comments