Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial RPC_GET_VOLUME_STAT support #113

Merged
merged 3 commits into from
Oct 18, 2023

Conversation

BeryJu
Copy link
Contributor

@BeryJu BeryJu commented Aug 7, 2023

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 digitalocean/csi-digitalocean#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 fine

General:

  • Have you removed all sensitive information, including but not limited to access keys and passwords?
  • Have you checked to ensure there aren't other open or closed Pull Requests for the same bug/feature/question?

Pull Request Guidelines:

  1. Does your submission pass tests?
  2. Have you added tests?
  3. Are you addressing a single feature in this PR?
  4. Are your commits atomic, addressing one change per commit?
  5. Are you following the conventions of the language?
  6. Have you saved your large formatting changes for a different PR, so we can focus on your work?
  7. Have you explained your rationale for why this feature is needed?
  8. Have you linked your PR to an open issue

@luthermonson
Copy link
Contributor

@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

@tchinmai7
Copy link
Contributor

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.

@tchinmai7 tchinmai7 merged commit 2b653c9 into linode:master Oct 18, 2023
@BeryJu BeryJu deleted the add-RPC_GET_VOLUME_STATS branch October 18, 2023 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Monitoring Kubernetes PVs
3 participants