CSI: implement GetCapacity / NodeGetVolumeStatus
- Dominant language
- Go
- Stars
- 17k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 105
Description
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 status` already exists. If the volume’s plugin allows, we can call GetCapacity and NodeGetVolumeStatus and provide the additional information in the `nomad volume status :volume_id` detail 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 =
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
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the existing `nomad volume status :volume_id` detail view and trace how CSI plugin responses are exposed; read the referenced internal design excerpt and reconcile the requested GetCapacity and NodeGetVolumeStatus RPCs with the example's NodeGetVolumeStats section. Done means the detail view presents the additional capacity, availability, total, and node-status information when the plugin supports it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend, cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100