Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set fsGroupChangePolicy to OnRootMismatch #533

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RisingOpsNinja
Copy link

The helm chart sets fsGroup and the Kubernetes cluster may sets fsGroupChangePolicy to Always by default, which causes the group permissions of all files on the PVC to be adjusted every time, when the volume is mounted (e.g. container restart).

This leads to the following issues:

To resolve this issues, set fsGroupChangePolicy to OnRootMismatch by default. This will only change ownership and permissions when the top level root directory has incorrect permission, which should only occur with an empty PVC at the initial deployment.

By default, Kubernetes 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.

fsGroupChangePolicy - 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:

    OnRootMismatch: Only change permissions and ownership if the permission and the ownership of root directory does not match with expected permissions of the volume. This could help shorten the time it takes to change ownership and permission of a volume.
    Always: Always change permission and ownership of the volume when volume is mounted. 

Source: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#configure-volume-permission-and-ownership-change-policy-for-pods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect SSH key permissions (0660) set by Weblate GUI causing Git operations to fail
1 participant