kubernetes-csi / csi-driver-host-path

A sample (non-production) CSI Driver that creates a local directory as a volume on a single node
Apache License 2.0
315 stars 206 forks source link

Hostpath driver does not export volume metrics #273

Closed stoneshi-yunify closed 3 years ago

stoneshi-yunify commented 3 years ago

The hostpath driver does not export volume metrics, can not see any kubelet_volumestats* metrics in Prometheus.

Per CSI spec:

A Node plugin MUST implement this RPC call if it has GET_VOLUME_STATS node capability or VOLUME_CONDITION node capability. NodeGetVolumeStats RPC call returns the volume capacity statistics available for the volume.

However, the hostpath driver does not enable the GET_VOLUME_STATS node capability, per https://github.com/kubernetes-csi/csi-driver-host-path/blob/master/pkg/hostpath/nodeserver.go#L317 . It only enables the VOLUME_CONDITION node capability.

stoneshi-yunify commented 3 years ago

I'd like to submit a PR to fix this issue. Could someone assign this issue to me? Thanks.

pohly commented 3 years ago

/assign @stoneshi-yunify

Might not work, though, if you aren't a collaborator. We'll see...