简体   繁体   中英

csi-cephfs: how can I get ceph storage cluster available capacity from kubernetes

  1. My goal is to get the capacity of ceph cluster by ceph-csi in kubernetes

  2. Same as the command in ceph 'ceph -s' usage: 10 Gib used, 12GiB /22 GiB avail

  3. Version is

     ceph-csi v3.6.0 kubernetes v1.21.8
  4. I already hava open the kubernetes feature gate CSIVolumeHealth,but in prometheus I did not find any useful info,only kubelet_volume_stats_*,but that all about persistenceVolume,not ceph cluster capacity.

anyone can help? plz

Same for me, the following Prometheus query works well for all PVCs except for Ceph OSDs PVCs:

    (
      sum without(instance, node) (kubelet_volume_stats_used_bytes{job="kubelet",metrics_path="/metrics",persistentvolumeclaim=~".*"})
      /
      sum without(instance, node) (kubelet_volume_stats_capacity_bytes{job="kubelet", metrics_path="/metrics", persistentvolumeclaim=~".*"})
    ) * 100

Reference:https://github.com/redhat-cop/volume-expander-operator/issues/9

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM