Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: KubePersistentVolumeFillingUp - false alert fires for PVCs with volumeMode as block #636

Conversation

arajkumar
Copy link
Contributor

@arajkumar arajkumar commented Jul 2, 2021

After [1] kubelet metrics kubelet_volume_stats_available_bytes and kubelet_volume_stats_used_bytes are set to 0 for all block PVC mounts. This causes the KubePersistentVolumeFillingUp alert to be fired immediately.

Block volume mount stats can't really carry the kubelet_volume_stats_used_bytes because it is a raw storage device, not a file system. It is upto the workloads to deal with raw devices.

This PR fixes the alert expression by testing kubelet_volume_stats_used_bytes > 0 which prevents alert for block volume mounts.

[1] kubernetes/kubernetes@b997e0e

Signed-off-by: Arunprasad Rajkumar arajkuma@redhat.com

@simonpasquier
Copy link
Contributor

lgtm. It would be good to add a unit test for the kubelet_volume_stats_used_bytes == 0 case.

@arajkumar arajkumar force-pushed the patch-KubePersistentVolumeFillingUp-for-block-vol branch from 85e8c51 to c1dd159 Compare July 2, 2021 14:35
@arajkumar
Copy link
Contributor Author

Thanks @simonpasquier, Added tests with kubelet_volume_stats_used_bytes == 0 .

@arajkumar arajkumar force-pushed the patch-KubePersistentVolumeFillingUp-for-block-vol branch from c1dd159 to b86d50c Compare July 2, 2021 14:40
tests.yaml Outdated Show resolved Hide resolved
…volumeMode as block

After [1] kubelet metrics `kubelet_volume_stats_available_bytes` and `kubelet_volume_stats_used_bytes` are set to 0 for all block PVC mounts. This causes the `KubePersistentVolumeFillingUp` alert to be fired immediately.

Block volume mount stats can't really carry the `kubelet_volume_stats_used_bytes` because it is a raw storage device, not a file system. It is upto the workloads to deal with raw devices.

This PR fixes the alert expression by testing `kubelet_volume_stats_used_bytes > 0` which prevents alert for block volume mounts.

[1] kubernetes/kubernetes@b997e0e

Signed-off-by: Arunprasad Rajkumar <arajkuma@redhat.com>
@arajkumar arajkumar force-pushed the patch-KubePersistentVolumeFillingUp-for-block-vol branch from b86d50c to b92f53d Compare July 2, 2021 16:08
Copy link
Contributor

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants