-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Shared folder inotify issue with multiple containers on EKS using gVisor #11326
Comments
would you mind sharing gvisor debugging logs from you EKS cluster? also, have you tried the workflow w/o gvisor sandbox on EKS, how does that work for you? |
In Kubernetes, a pod is started one container at a time, with no single view over the entire pod. gVisor mounts container volumes independently from each other and as containers are starting up, it doesn’t know whether a volume will be shared with other containers or not. Because they are treated as independent volumes, changes to shared volumes from one container are viewed as external changes to other containers. While these changes are detected when files are accessed, inofity doesn’t work on them (due to #8089). To solve this problem, we added a set of “mount hints”, that are passed in the form of annotations, to tell how volumes should be mounted. GKE does that automatically in the control plane, that’s why you see this working in GKE and not in vanilla K8s. Here’s an overview of the annotations that need to be set:
In your case, you want to set annotations for I haven’t tested, but these annotations should work for you:
Also, apart from inotify working, performance will be better since file access will not require revalidation and the volume is mounted directly inside gVisor. Please, give it a try and let us know if it works. Also, make sure to use runsc shim in the node, as there is some handling of the annotations in there. The documentation for these annotations are a bit spread out in the code. I’ll consolidate them to a single place, so it’s easier to reference in the future. |
@fvoznika this did not work i have reread your guide and all the links multiple times. after setting the annotations to be the same as in GKE and or as in your guide and also multiple other configurations. i do see annotations are recognized in the logs but inotify still doesn't work if the file is edited from the second container. all works if gvisor is off or using the same container as the file system watcher
is all i see in the logs. when putting gvisor off all still works. is there any chance to get your help in a debug session as part of enterprise support? |
According to the logs above, the annotations are not making into runsc. There is one more step to follow, which to tell containerd that you allow certain pod annotations to be propagated to the runtime. Please add
This should do it. If it still doesn't work, please share debug logs and the contents of |
@fvoznika thank you! |
Yes we most definitely would! |
Description
I encountered an issue when running a Pod with two containers sharing a folder in a Kubernetes cluster using gVisor. The expected behavior is for one container to detect file changes in the shared folder made by the other container, and send an event when a file is modified. However, this works as expected on GKE, but fails on EKS using the latest version of gVisor.
it is similar to #8089
but i see it works on GKE
Additional Information
inotify
, whichchokidar
relies on for file change detection.Debugging Done
stat
andcat
.chokidar
, which bypassesinotify
, and confirmed that events are then detected correctly, suggesting the issue lies withinotify
.Request
Please investigate why
inotify
-based file change detection in shared folders fails on EKS with gVisor, but works on GKE.Let me know if further details or logs are required. Thank you!
This format should provide enough clarity and context for the maintainers to understand and replicate the issue.
Steps to reproduce
Environment Setup:
chokidar
library in Node.js is used to listen for file changes. This library relies oninotify
.Pod Configuration:
Container 1 Code (watcher.js):
Expected Behavior:
/shared/test.txt
every time container 2 modifies the file.Observed Behavior:
chokidar
when container 2 modifies the file.chokidar
detects changes correctly.runsc version
docker version (if using docker)
uname
Linux ip-10-59-118-142.ec2.internal 5.10.226-214.880.amzn2.x86_64 #1 SMP Tue Oct 8 16:18:15 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
kubectl (if using Kubernetes)
repo state (if built from source)
No response
runsc debug logs (if available)
The text was updated successfully, but these errors were encountered: