add volume kubelet_volume_stats_health_abnormal to kubelet

This commit is contained in:
fengzixu
2021-10-09 15:37:43 +09:00
parent f86ee5649b
commit d71e21e01e
6 changed files with 42 additions and 0 deletions

View File

@@ -200,6 +200,9 @@ func (s *volumeStatCalculator) parsePodVolumeStats(podName string, pvcRef *stats
return stats.VolumeStats{
Name: podName,
PVCRef: pvcRef,
VolumeHealthStats: stats.VolumeHealthStats{
Abnormal: *metric.Abnormal,
},
FsStats: stats.FsStats{Time: metric.Time, AvailableBytes: &available, CapacityBytes: &capacity,
UsedBytes: &used, Inodes: &inodes, InodesFree: &inodesFree, InodesUsed: &inodesUsed},
}

View File

@@ -283,6 +283,7 @@ func expectedBlockMetrics() *volume.Metrics {
Available: resource.NewQuantity(available, resource.BinarySI),
Capacity: resource.NewQuantity(capacity, resource.BinarySI),
Used: resource.NewQuantity(available-capacity, resource.BinarySI),
Abnormal: &volumeCondition.Abnormal,
}
}