CSI: implement GetCapacity / NodeGetVolumeStatus
Splitting out of https://github.com/hashicorp/nomad/issues/8212, as we're most likely going to ship the create and snapshot workflows in Nomad 1.1.0 without having shipped GetCapacity and NodeGetVolumeStatus.
From our internal design doc:
nomad volume statusalready exists. If the volume’s plugin allows, we can call GetCapacity and NodeGetVolumeStatus and provide the additional information in thenomad volume status :volume_iddetail view. In the example below, the bolded sections are new and come from the NodeGetVolumeStats RPC. Note that the Stats section may present the units in either bytes or inodes, depending on the plugin.
$ nomad volume status test-volume0
ID = test-volume0
Name = test-volume0
External ID = 45e10f8a-4ecd-11eb-8ed9-0242ac110002
Plugin ID = hostpath-plugin0
Provider = csi-hostpath
Version = v1.2.0-0-g83590990
Schedulable = true
Controllers Healthy = 0
Controllers Expected = 0
Nodes Healthy = 1
Nodes Expected = 1
Condition = abnormal (provider-message-goes-here)
Access Mode = single-node-writer
Attachment Mode = file-system
Mount Options = <none>
Namespace = default
Stats
Used Available Total
2GiB 3GiB 5GiB
Allocations
ID Node ID Task Group Version Desired Status Created Modified
c8640c da5bda cache 0 run running 19m ago 18m ago
2ab6f5 da81da cache 0 run running 19m ago 18m ago
Any probability this gets implemented? I am looking to monitor the health and free space of CSI volumes and having NodeGetVolumeStats work would be a good step towards that.