Skip to content

Commit

Permalink
storage capacity: use AvailableCapacity
Browse files Browse the repository at this point in the history
The API now uses the same name as the CSI spec and defers to that spec
with regards to the semantic of the value.
  • Loading branch information
pohly committed May 18, 2020
1 parent b75421d commit 6af515b
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions keps/sig-storage/1472-storage-capacity-tracking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,18 +332,20 @@ type CSIStorageCapacitySpec struct {
// CSIStorageCapacityStatus contains the properties that can change over time.
type CSIStorageCapacityStatus struct {
// Capacity is the value reported by the CSI driver in its GetCapacityResponse.
// Depending on how the driver is implemented, this might be the total
// size of the available storage which is only available when allocating
// multiple smaller volumes ("total available capacity") or the
// actual size that a volume may have ("maximum volume size").
Capacity *resource.Quantity
// AvailableCapacity is the value reported by the CSI driver in its GetCapacityResponse
// for a GetCapacityRequest with topology and parameters that match the
// CSIStorageCapacitySpec.
//
// The semantic is currently (CSI spec 1.2) defined as:
// The available capacity, in bytes, of the storage that can be used
// to provision volumes.
AvailableCapacity *resource.Quantity
}
```

`Capacity` is a pointer because `TotalCapacity` and
`AvailableCapacity` is a pointer because `TotalCapacity` and
`MaximumVolumeSize` might be added later, in which case `nil` for
`Capacity` will become allowed.
`AvailableCapacity` will become allowed.

Compared to the alternatives with a single object per driver (see
[`CSIDriver.Status`](#csidriverstatus) below) and one object per
Expand Down Expand Up @@ -377,7 +379,7 @@ spec:
values:
- node-1
status:
capacity: 256G
availableCapacity: 256G
apiVersion: storage.k8s.io/v1alpha1
kind: CSIStorageCapacity
Expand All @@ -394,7 +396,7 @@ spec:
values:
- node-2
status:
capacity: 512G
availableCapacity: 512G
```

##### Example: affect of storage classes
Expand All @@ -415,7 +417,7 @@ spec:
values:
- node-1
status:
capacity: 256G
availableCapacity: 256G
apiVersion: storage.k8s.io/v1alpha1
kind: CSIStorageCapacity
Expand All @@ -432,7 +434,7 @@ spec:
values:
- node-1
status:
capacity: 128G
availableCapacity: 128G
```

##### Example: network attached storage
Expand All @@ -453,7 +455,7 @@ spec:
values:
- us-east-1
status:
capacity: 128G
availableCapacity: 128G
apiVersion: storage.k8s.io/v1alpha1
kind: CSIStorageCapacity
Expand All @@ -470,7 +472,7 @@ spec:
values:
- us-west-1
status:
capacity: 256G
availableCapacity: 256G
```

#### CSIDriver.spec.storageCapacity
Expand Down

0 comments on commit 6af515b

Please sign in to comment.