﻿# Grant model-volume access without changing every file manually

fsGroup behavior is volume- and driver-dependent; verify the actual reader and distinguish ownership work from mount constraints.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/guide-ks-fsgroup-artifact/
Language: en

A nonroot serving process mounts an artifact volume but cannot traverse its directories or read model files. Rebuilding the image does not change the volume's existing ownership. fsGroup can provide supported group-based volume access, but its behavior depends on the volume type and storage driver.

## Identify the real permission failure

Record the service process's user and groups, directory traversal permissions and a representative file's ownership. Keep file contents out of the report. A primary process group and the group applied to a mounted volume are related but different settings. Setting runAsGroup alone should not be assumed to rewrite existing volume ownership.

## Read supported fsGroup behavior

For volume types supporting it, Pod securityContext fsGroup affects volume ownership and permissions and makes the group available to processes as documented. Check the actual storage path rather than expecting identical behavior for every source. A read-only mount also remains a separate access constraint even when group ownership is correct.

## Account for recursive startup work

Changing ownership across a large artifact tree can delay startup. fsGroupChangePolicy controls supported ownership handling; OnRootMismatch can avoid a recursive change when the root already matches. That shortcut is not proof that every preexisting child has the desired mode. Qualify the prepared tree and do not hide inconsistent files behind a matching root directory.

## Check CSI delegation

A CSI driver advertising the supported mount-group capability can handle group application itself. In that case Kubernetes does not perform the ownership change and fsGroupChangePolicy does not take effect as though kubelet owned the operation. Inspect driver documentation and capability context before blaming an apparently ignored setting.

## Test access with the service identity

In an isolated disposable volume, create synthetic directories and files with deliberately different ownership. Mount through the intended driver and verify permitted reads using the actual service identity. Compare startup behavior without promising a universal speedup. Acceptance means supported access and an understood preparation cost. It does not grant all containers unrestricted access, validate the model bytes or replace backup and artifact-integrity checks merely because the file can now be opened.

## Primary references

[Configure a Pod or Container Security Context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/).

[Kubernetes Volumes](https://kubernetes.io/docs/concepts/storage/volumes/).

[Kubernetes Persistent Volumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/).

Related reading: [Equipment security when joining a GPU pool](/journal/hardware-security/); [Init container downloads an artifact again: making preparation idempotent](/journal/kubernetes-init-artifact-download/).
