Skip to content

Commit 2124d31

Browse files
author
Lisa Pettyjohn
committed
OSDOCS-2455:fsGroup
1 parent 326374e commit 2124d31

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * storage/understanding-persistent-storage.adoc
4+
5+
[id="using_fsGroup_{context}"]
6+
= Using fsGroup to reduce pod timeouts
7+
8+
If a storage volume contains many files (~1,000,000 or greater), you may experience pod timeouts.
9+
10+
This can occur because, by default, {product-title} recursively changes ownership and permissions for the contents of each volume to match the `fsGroup` specified in a pod's `securityContext` when that volume is mounted. For large volumes, checking and changing ownership and permissions can be time consuming, slowing pod startup. You can use the `fsGroupChangePolicy` field inside a `securityContext` to control the way that {product-title} checks and manages ownership and permissions for a volume.
11+
12+
`fsGroupChangePolicy` defines behavior for changing ownership and permission of the volume before being exposed inside a pod. This field only applies to volume types that support `fsGroup`-controlled ownership and permissions. This field has two possible values:
13+
14+
* `OnRootMismatch`: Only change permissions and ownership if permission and ownership of root directory does not match with expected permissions of the volume. This can help shorten the time it takes to change ownership and permission of a volume to reduce pod timeouts.
15+
16+
* `Always`: Always change permission and ownership of the volume when a volume is mounted.
17+
18+
.`fsGroupChangePolicy` example
19+
[source,yaml]
20+
----
21+
securityContext:
22+
runAsUser: 1000
23+
runAsGroup: 3000
24+
fsGroup: 2000
25+
fsGroupChangePolicy: "OnRootMismatch" <1>
26+
...
27+
----
28+
<1> `OnRootMismatch` specifies skipping recursive permission change, thus helping to avoid pod timeout problems.
29+
30+
[NOTE]
31+
====
32+
The fsGroupChangePolicyfield has no effect on ephemeral volume types, such as secret, configMap, and emptydir.
33+
====

storage/understanding-persistent-storage.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ include::modules/storage-persistent-storage-block-volume.adoc[leveloffset=+1]
2828

2929
include::modules/storage-persistent-storage-block-volume-examples.adoc[leveloffset=+2]
3030
endif::openshift-enterprise,openshift-webscale,openshift-origin[]
31+
32+
include::modules/storage-persistent-storage-fsGroup.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)