fix: replace netstat with /proc/net/tcp for port availability checks#2890
Closed
barnabasbusa wants to merge 1 commit intomainfrom
Closed
fix: replace netstat with /proc/net/tcp for port availability checks#2890barnabasbusa wants to merge 1 commit intomainfrom
barnabasbusa wants to merge 1 commit intomainfrom
Conversation
The fluent-bit debug container (distroless:debug) does not include netstat, causing the logs collector port check to always fail on k8s. Use /proc/net/tcp which works on any Linux container without tool deps. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
Author
|
Closing as it is now part of #2891 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fluent-bit debug container (distroless:debug) does not include netstat, causing the logs collector port check to always fail on k8s. Use /proc/net/tcp which works on any Linux container without tool deps.
When it broke: Commit be932f7 ("impl k8s fluentbit collector availability check", Feb 18, 2025), merged via PR #2653 at commit 05e3813 ("feat:
fluent bit logs collector in k8s backend", Feb 22, 2025). This has been broken since day one of the k8s logs collector feature - it was never
working.
Root cause: The port availability check runs netstat -anp tcp | grep LISTEN | grep 9713 via kubectl exec inside the fluent/fluent-bit:4.0.0-debug
container. That image is based on Google's distroless:debug, which has a minimal busybox that does not include netstat. The engine and API
containers are Alpine-based and have busybox netstat, so their checks work fine.
The fix: Replaced the netstat command with a /proc/net/tcp check in both the Kubernetes and Docker backends:
grep -i ':25F1 ' /proc/net/tcp /proc/net/tcp6 2>/dev/null | grep -qi ' 0A '