metal-stack / csi-driver-lvm

MIT License
120 stars 25 forks source link

Capacity tracking support #89

Open jleeh opened 1 year ago

jleeh commented 1 year ago

Enable storage capacity tracking as per the CSI documentation: https://kubernetes-csi.github.io/docs/storage-capacity-tracking.html

While using this CSI driver in-cluster, I hit issues where pods would be attempted to be scheduled on nodes that didn't have enough disk space remaining to satisfy the request while the topology requirements kept the same so the provisioner would get in an endless error loop.

Since capacity requests aren't supported in the node server, this takes the same approach to provisioning in which a pod is created on the specified node to check remaining capacity based on the device pattern.

Tested in-cluster and is working.

majst01 commented 1 year ago

Nice !

jleeh commented 1 year ago

Thanks! Will get the comments actioned and add a test that asserts the storage capacity objects get created.

jleeh commented 1 year ago

Got this updated and tested in-cluster. Couldn't unfortunately add tests as I realised it depended on the helm chart changes to enable capacity tracking.

majst01 commented 1 year ago

Got this updated and tested in-cluster. Couldn't unfortunately add tests as I realised it depended on the helm chart changes to enable capacity tracking.

having tests for this would be very much appreciated

jleeh commented 1 year ago

@majst01 since the tests install the helm chart and for capacity tracking to be enabled it requires the helm chart changes as per this PR: https://github.com/metal-stack/helm-charts/pull/68/files

How would you propose to add tests? One solution would be to disable capacity tracking in that PR by default, then enable it in the values file in this repo for testing.

Gerrit91 commented 11 months ago

Hey @jleeh,

having the feature disabled by default and then enable it for integration testing in this repository sounds good to me.

I just allowed your PR in the helm repo to be built such that there will also be a PR helm repo available that you can use for trying out your changes (https://helm.metal-stack.io/pull_requests/<branch-name>).