Closed hbzhu closed 2 years ago
block-pvc-scanner的log里有什么提示?
2021-12-01 09:15:08,282 - block_pvc_scanner - INFO - Will sleep 15s... │ │ 2021-12-01 09:15:23,299 - block_pvc_scanner - INFO - Will sleep 15s... │ │ 2021-12-01 09:15:38,323 - block_pvc_scanner - INFO - Will sleep 15s... │ │ 2021-12-01 09:15:53,350 - block_pvc_scanner - INFO - Will sleep 15s... │ │ 2021-12-01 09:16:08,372 - block_pvc_scanner - INFO - Will sleep 15s... │ │ 2021-12-01 09:16:23,392 - block_pvc_scanner - INFO - Will sleep 15s... │ │ 2021-12-01 09:16:38,411 - block_pvc_scanner - INFO - Will sleep 15s...
进到block-pvc-scanner容器里执行df -h|grep flexvolume
,然后能把完整的路径放出来吗?我看看是不是匹配不到
/usr/src/app # df -h |grep flex /dev/vdb 19.6G 2.4G 16.1G 13% /host/var/lib/kubelet/plugins/kubernetes.io/flexvolume/alicloud/disk/mounts/d-uf63jr560**
那它对应的PVC方便describe 一下,贴下结果吗
Name: search-es-data-search-es-0
Namespace: common
StorageClass: alicloud-disk-essd
Status: Bound
Volume: d-uf63jr560**
Labels: name.app.*.cn=search-es
Annotations: control-plane.alpha.kubernetes.io/leader={"holderIdentity":"216c664a-d972-11e9-8346-0a***","leaseDurationSeconds":15,"acquireTime":"2021-04-07T05:35:33Z","renewTime":"2021-04-07T05:35:35Z","lea...
pv.kubernetes.io/bind-completed=yes
pv.kubernetes.io/bound-by-controller=yes
volume.beta.kubernetes.io/storage-provisioner=alicloud/disk
Finalizers: [kubernetes.io/pvc-protection]
Capacity: 20Gi
Access Modes: RWO
Events:
把block-pvc-scanner的镜像换成这个试试 dockerid31415926/block-pvc-scanner:tmp
感谢大佬,已经能获取到pvc_usage 指标数据了
客气啦
(sum without (container,pod,service,namespace,job,instance,endpoint) (pvc_usage)) + on(volumename) group_left(persistentvolumeclaim,mountedby,pod_namespace)pvc_mapping*0 获取不到数据,貌似是volumename="d-uf65cq8kmgh***bha "} 多了空格
哪个metric的返回多空格?
pvc_usage{volumename="d-uf65cq8km*ubha "}
日志显示也是
2021-12-03 07:32:47,427 - block_pvc_scanner - INFO - VOLUME: d-uf6fjo4***y0g2r
, USAGE: 0.96
是VOLUME: ('d-uf6j297lwv***bap\n 默认带了换行符
修改pv=volume.rstrip() ,已经可以了,谢谢大佬
您好,使用的是阿里云flexvolume,运行的pvc-exporter-0.1.2,block-pvc-scanner获取不到pvc_usage指标,只有pvc_mapping
/dev/vdc 689G 584G 73G 89% /var/lib/kubelet/plugins/kubernetes.io/flexvolume/alicloud/disk/mounts/d-uf634xb8**