Description
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
- Assumption: This issue is likely related to
inotify
, whichchokidar
relies on for file change detection. - Environment Details:
- gVisor version: 20241217.0
- EKS Kubernetes version: 1.30 (gvisor is installed with default settings)
- GKE Kubernetes version: 1.30
Debugging Done
- Verified that changes to the shared folder are visible within both containers using
stat
andcat
. - Tested on GKE and confirmed that the issue does not occur there.
- Attempted enabling polling mode in
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:
- Kubernetes cluster running on EKS with gVisor installed.
- Pod specification:
- Two containers.
- Shared folder mounted as a volume.
chokidar
library in Node.js is used to listen for file changes. This library relies oninotify
.
-
Pod Configuration:
apiVersion: v1 kind: Pod metadata: name: shared-folder-test spec: runtimeClassName: gvisor containers: - name: container1 image: node:14 command: ["node", "watcher.js"] volumeMounts: - name: shared-folder mountPath: /shared - name: container2 image: busybox command: ["/bin/sh", "-c", "while true; do echo 'hello' > /shared/test.txt; sleep 2; done"] volumeMounts: - name: shared-folder mountPath: /shared volumes: - name: shared-folder emptyDir: {}
-
Container 1 Code (watcher.js):
const chokidar = require('chokidar'); const watcher = chokidar.watch('/shared', { persistent: true, }); watcher.on('change', (path) => { console.log(`${path} changed`); });
-
Expected Behavior:
- Container 1 logs changes to
/shared/test.txt
every time container 2 modifies the file.
- Container 1 logs changes to
-
Observed Behavior:
- On EKS with gVisor, no changes are detected by
chokidar
when container 2 modifies the file. - On GKE with gVisor,
chokidar
detects changes correctly.
- On EKS with gVisor, no changes are detected by
runsc version
runsc version release-20241217.0
spec: 1.1.0-rc.1
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)
Client Version: v1.31.4
Kustomize Version: v5.4.2
Server Version: v1.30.7-eks-56e63d8
repo state (if built from source)
No response