Skip to content

Commit

Permalink
Fix the definition of the VolumeAttributesClass
Browse files Browse the repository at this point in the history
  • Loading branch information
carlory committed Jul 6, 2023
1 parent ab8951b commit 5be3d66
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions keps/sig-storage/3751-volume-attributes-class/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,30 +126,31 @@ Currently after CreateVolume with provider specific parameters pass in storage c
## Proposal

### Kubernetes API
We need to add a new resource object VolumeAttributesClass to Kubernetes API, also a new admission controller and vac protection controller. Please see more in [Design Details](#bookmark=id.wtvwymf8202g).
We need to add a new resource object VolumeAttributesClass to Kubernetes API, also a new admission controller and vac protection controller. Please see more in [Design Details](#design-details).

The reason why we cannot use StorageClass.parameters is because StorageClass is immutable today. The design is to introduce a VolumeAttributesClass with parameters. Although these parameters are still immutable within a VolumeAttributesClass, the name of VolumeAttributesClass in a PVC can be modified. This allows the parameters representing volume attributes to be updated after a volume is created.

If there is conflict between StorageClass.parameters and VolumeAttributesClass.parameters, the driver should return an error.

```
// VolumeAttributesClass represents a class of volume attributes. It holds the mutable
// attributes of volumes for the provisioner that should create and update volumes.
//
// VolumeAttributesClasses are non-namespaced; the name of the volume attributes class
// according to etcd is in ObjectMeta.Name.
type VolumeAttributesClass struct {
metav1.TypeMeta
// +optional
metav1.ObjectMeta
// Spec defines the behavior of a VolumeAttributesClass.
// +optional
Spec VolumeAttributesClassSpec
}
type VolumeAttributesClassSpec struct {
// Name of the driver
DriverName string
// This field is OPTIONAL.This allows the CO to specify the
// volume attributes class parameters to apply.
// These parameters are immutable
Parameters map[string]string
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// parameters holds the mutable attributes of volumes for the provisioner that should
// create and update volumes of this volume attributes class. And these parameters are
// immutable.
// +optional
Parameters map[string]string `json:"parameters,omitempty" protobuf:"bytes,3,rep,name=parameters"`
}
type PersistentVolumeSpec struct {
Expand Down Expand Up @@ -1084,7 +1085,7 @@ For ResourceQuota, we will verify that sum of spec.resources[iops] and spec.reso
* Not all the storage providers support independently configurable iops/throughput


#### Option 2: Opaque map in CreateVolume and ModifyVolume requests by end users
### Option 2: Opaque map in CreateVolume and ModifyVolume requests by end users

The users will set the volume performance parameters directly in the PVC:

Expand Down Expand Up @@ -1123,19 +1124,19 @@ message ModifyVolumeRequest {



##### Pros:
#### Pros:

* Flexible to fit into all the cloud providers
* More flexibility to end users and no cluster administrator needs to be involved(also a con)


##### Cons:
#### Cons:

* More unpredictable behaviors because it is an opaque map. Compared to the recommended approach that the cluster administrator actually has the control over the values.
* Not portable across different cloud providers.


#### Option 3: A cluster administrator modifies the VolumeAttributesClass parameters which will cause all PVCs using that performance class to be updated.
### Option 3: A cluster administrator modifies the VolumeAttributesClass parameters which will cause all PVCs using that performance class to be updated.

![VolumeAttributesClass Batch Update](./VolumeAttributesClass-BatchUpdate.png)

Expand Down Expand Up @@ -1191,7 +1192,6 @@ volumeBindingMode: WaitForFirstConsumer
```
apiVersion: storage.k8s.io/v1alpha1
kind: VolumeAttributesClass
driverName: pd.csi.storage.gke.io
metadata:
name: silver
parameters:
Expand Down

0 comments on commit 5be3d66

Please sign in to comment.