Skip to content

Commit 5373cee

Browse files
Update concepts-storage.md
fsgroup support, bug https://msazure.visualstudio.com/One/_workitems/edit/32613759
1 parent 7c000b9 commit 5373cee

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

AKS-Arc/concepts-storage.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,24 @@ volumeMounts:
111111
- mountPath: "c:\k"
112112
name: k-dir
113113
```
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.
130+
131+
114132

115133
## Next steps
116134

0 commit comments

Comments
 (0)