fix(kind): set containerd LimitNOFILE to 4096 to avoid valgrind failure#6337
fix(kind): set containerd LimitNOFILE to 4096 to avoid valgrind failure#6337
Conversation
The default LimitNOFILE=infinity in Kind nodes causes valgrind to fail with the following error: libcfile Valgrind: FATAL: Private file creation failed. The current file descriptor limit is 1073741804. If you are running in Docker please consider lowering this limit with the shell built-in limit command. Exiting now. Set LimitNOFILE=4096 for containerd on all Kind nodes after cluster creation to prevent this issue. Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com>
Summary of ChangesHello @oilbeater, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a critical issue where Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively resolves the valgrind failure by correctly adjusting the LimitNOFILE setting for containerd on Kind nodes. The changes ensure that the containerd service is reconfigured and restarted after cluster creation, which directly addresses the problem described.
| define kind_create_cluster | ||
| kind create cluster --config $(1) --name $(2) | ||
| @for node in $$(kind get nodes --name $(2)); do \ | ||
| docker exec $$node sed -i 's/LimitNOFILE=infinity/LimitNOFILE=4096/' /etc/systemd/system/containerd.service; \ |
There was a problem hiding this comment.
Using sed -i to modify systemd service files can be brittle. If the format or content of /etc/systemd/system/containerd.service changes in a future update, the sed command might fail or produce unintended results. A more robust approach is to create a systemd drop-in file (override.conf) to apply specific settings. This method ensures that your changes are preserved and applied correctly, even if the main service file is updated.
docker exec $$node mkdir -p /etc/systemd/system/containerd.service.d; docker exec $$node sh -c 'echo -e "[Service]\nLimitNOFILE=4096" > /etc/systemd/system/containerd.service.d/override.conf'; \
…re (#6337) The default LimitNOFILE=infinity in Kind nodes causes valgrind to fail with the following error: libcfile Valgrind: FATAL: Private file creation failed. The current file descriptor limit is 1073741804. If you are running in Docker please consider lowering this limit with the shell built-in limit command. Exiting now. Set LimitNOFILE=4096 for containerd on all Kind nodes after cluster creation to prevent this issue. Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
LimitNOFILE=4096for containerd on all Kind nodes after cluster creationLimitNOFILE=infinitycauses valgrind to fail with:Test plan
make kind-initto create clusterLimitNOFILE=4096on all nodes:docker exec <node> grep LimitNOFILE /etc/systemd/system/containerd.servicedocker exec <node> systemctl status containerd🤖 Generated with Claude Code