-
Notifications
You must be signed in to change notification settings - Fork 150
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
Add KB for the issue volumes with lot of files take a long time to finish mounting
#265
Conversation
46775a7
to
f1b28bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @catherineluse can you help to take a look as well?
|
||
When starting workload pod which uses Longhorn volumes, | ||
observe in Longhorn UI that the Longhorn volumes are attached quickly | ||
but it takes a long time for the volumes to finish mounting and workload to be able to start. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When starting a workload pod that uses Longhorn volumes,
the Longhorn UI shows that the Longhorn volumes are attached quickly,
but it takes a long time for the volumes to finish mounting and for the workload to be able to start.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Fixed
observe in Longhorn UI that the Longhorn volumes are attached quickly | ||
but it takes a long time for the volumes to finish mounting and workload to be able to start. | ||
|
||
This issue only happens when Longhorn volumes that have many files/directories and the workload pod sets `fsGroup` in the `securityContext` similar to as below: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This issue only happens when the Longhorn volumes have many files/directories and securityContext.fsGroup
is set in the workload pod as shown below:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Fixed
|
||
## Reason | ||
|
||
By default, when seeing `fsGroup` field, each time a volume is mounted, Kubernetes recursively `chown()` and `chmod()` all the files and directories inside the volume. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, when seeing the fsGroup
field, each time a volume is mounted, Kubernetes recursively calls chown()
and chmod()
on all the files and directories inside the volume.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Fixed
When `fsGroupChangePolicy` is set to `OnRootMismatch`, if the root of the volume already has the correct permissions, | ||
the recursive permission and ownership change will be skipped. | ||
It means that if users don't change the `pod.spec.securityContext.fsGroup` between pod's startups, | ||
K8s will only have to check the permissions and ownership of the root and the mounting process will be much faster compared to always recursively change the volumes' ownership and permissions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compared to always recursively changing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Fixed
…inish mounting` longhorn/longhorn#2131 Signed-off-by: Phan Le <phan.le@rancher.com>
f1b28bc
to
ee4d64f
Compare
Catherine's review comments are addressed |
@catherineluse can you review again? Thanks. |
longhorn/longhorn#2131