newrelic / nri-kubernetes

New Relic integration for Kubernetes
https://docs.newrelic.com/docs/integrations/kubernetes-integration/get-started/introduction-kubernetes-integration
Apache License 2.0
40 stars 51 forks source link

fix: pin mountPropagation of host fs in privileged mode (NR-274598) #1066

Closed gsanchezgavier closed 3 weeks ago

gsanchezgavier commented 3 weeks ago

Description

Infrastructure Agent captures Storage Samples of underlying nodes based on the mounted file system. Whenever a new pvc is mounted on the host, this mount needs to be propagated (rslave)to the mounted filesystem in the agent container.

By default k8s uses none as mount propagation, and according to k8s docs depends on the CRI which propagation is used rprivate or in some cases like docker rslave.

This PR configures the host file system volume to be mounted with rslave independently of the CRI. This fixes some miss behaving storage metrics samples where the device disk space of a newly mounted device has the value of the primary host storage ( and the issue was fixed upon Pod recreation)

Type of change

Checklist:

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 67.94%. Comparing base (8ce73d9) to head (6e0e030).

:exclamation: Current head 6e0e030 differs from pull request most recent head 3457d78

Please upload reports for the commit 3457d78 to get more accurate results.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1066 +/- ## ======================================= Coverage 67.94% 67.94% ======================================= Files 55 55 Lines 3379 3379 ======================================= Hits 2296 2296 Misses 904 904 Partials 179 179 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

juanjjaramillo commented 3 weeks ago

PR has been tested in #1068 All tests pass