Closed BeryJu closed 1 year ago
@BeryJu your code reads well and should be mergeable, we are spinning up a test to validate just to be thorough. for those who find this in the future and are curious on how this works... this PR enables the GRPC endpoint which is used with volume health monitoring. more documentation can be found in the csi docs
I tested that it works - and was able to get stats out of Kubelet
kubelet_volume_stats_available_bytes{namespace="monitoring",persistentvolumeclaim="storage-loki-in-cluster-0"} 1.043943424e+10
kubelet_volume_stats_capacity_bytes{namespace="monitoring",persistentvolumeclaim="storage-loki-in-cluster-0"} 1.0464022528e+10
kubelet_volume_stats_inodes{namespace="monitoring",persistentvolumeclaim="storage-loki-in-cluster-0"} 655360
kubelet_volume_stats_inodes_free{namespace="monitoring",persistentvolumeclaim="storage-loki-in-cluster-0"} 655331
kubelet_volume_stats_inodes_used{namespace="monitoring",persistentvolumeclaim="storage-loki-in-cluster-0"} 29
kubelet_volume_stats_used_bytes{namespace="monitoring",persistentvolumeclaim="storage-loki-in-cluster-0"} 7.811072e+06
needed to pass --feature-gates=[CSIVolumeHealth=true]
for kubelet to get this to work.
closes #62
Implement CSI RPC to support GET_VOLUME_STATS, which allows the kubelet to monitor PVC usage, which is most often used with prometheus and/or kube-prometheus-stack, and can be used to alert when a PVC is close to being full
based off of https://github.com/digitalocean/csi-digitalocean/pull/197
haven't added tests yet, but I built
ghcr.io/beryju/linode-blockstorage-csi-driver:v0.5.2-0-ge8e0af0-dirty
and am testing that in my LKE cluster, which seems to work fineGeneral:
Pull Request Guidelines: