[8.17](backport #6666) [k8s] Fix System Integration to utilise hostfs mounts #6809
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.
What does this PR do?
This PR ensures that the Elastic Agent system integration correctly utilizes the
/hostfs
mount to collect host-level metrics. Previously, the system integration only monitored processes visible within the container due to missing configuration settings for the/hostfs
path.The changes include:
system.hostfs: /hostfs
to all relevant system metricsets in both the Helm Chart templates and rendered manifests.Why is it important?
Without this fix, the Elastic Agent system integration collects only container-level metrics instead of full host-level metrics. This leads to incomplete observability of the Kubernetes nodes and limits visibility into host performance and resource utilization.
By explicitly setting
system.hostfs: /hostfs
, the agent can correctly access host-level/proc
and/sys
files, ensuring comprehensive monitoring.Checklist
./changelog/fragments
using the changelog tool.Disruptive User Impact
This change does not introduce breaking changes, as it only enhances system integration behavior without modifying existing user configurations. However, users who previously relied on container-only monitoring should be aware that host-level metrics will now be collected.
How to test this PR locally
/proc
and/sys
are mounted under/hostfs
inside the container.Related issues
Questions to ask yourself
This is an automatic backport of pull request #6666 done by [Mergify](https://mergify.com).