Skip to content

Commit ed296ca

Browse files
authored
Merge pull request #3693 from guanghuthegreat/patch-28
Update concepts-storage.md
2 parents 1fe803c + 6f3354e commit ed296ca

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

AKS-Arc/concepts-storage.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,23 @@ volumeMounts:
112112
name: k-dir
113113
```
114114

115+
## Secure pod access to mounted volumes
116+
117+
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.
118+
119+
**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.
120+
121+
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.
122+
123+
The following example YAML shows the **fsgroup** value:
124+
125+
```yaml
126+
securityContext:
127+
  fsGroup: 2000
128+
```
129+
130+
In this example, all files in mounted volumes are accessible by GID 2000.
131+
115132
## Next steps
116133

117134
- [Use the AKS on Azure Local disk Container Storage Interface (CSI) drivers](./container-storage-interface-disks.md).

0 commit comments

Comments
 (0)