Skip to content

Commit

Permalink
Merge pull request kubernetes#29006 from jsafrane/dynprov2
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

Implement dynamic provisioning (beta) of PersistentVolumes via StorageClass

Implemented according to PR kubernetes#26908. There are several patches in this PR with one huge code regen inside.

* Please review the API changes (the first patch) carefully, sometimes I don't know what the code is doing...

* `PV.Spec.Class` and `PVC.Spec.Class` is not implemented, use annotation `volume.alpha.kubernetes.io/storage-class`

* See e2e test and integration test changes - Kubernetes won't provision a thing without explicit configuration of at least one `StorageClass` instance!

* Multiple provisioning volume plugins can coexist together, e.g. HostPath and AWS EBS. This is important for Gluster and RBD provisioners in kubernetes#25026

* Contradicting the proposal, `claim.Selector` and `volume.alpha.kubernetes.io/storage-class` annotation are **not** mutually exclusive. They're both used for matching existing PVs. However, only `volume.alpha.kubernetes.io/storage-class` is used for provisioning, configuration of provisioning with `Selector` is left for (near) future.

* Documentation is missing. Can please someone write some while I am out?

For now, AWS volume plugin accepts classes with these parameters:

```
kind: StorageClass
metadata:
  name: slow
provisionerType: kubernetes.io/aws-ebs
provisionerParameters:
  type: io1
  zone: us-east-1d
  iopsPerGB: 10
```

* parameters are case-insensitive
* `type`: `io1`, `gp2`, `sc1`, `st1`. See AWS docs for details
* `iopsPerGB`: only for `io1` volumes. I/O operations per second per GiB. AWS volume plugin multiplies this with size of requested volume to compute IOPS of the volume and caps it at 20 000 IOPS (maximum supported by AWS, see AWS docs).
* of course, the plugin will use some defaults when a parameter is omitted in a `StorageClass` instance (`gp2` in the same zone as in 1.3).

GCE:

```
apiVersion: extensions/v1beta1
kind: StorageClass
metadata:
  name: slow
provisionerType: kubernetes.io/gce-pd
provisionerParameters:
  type: pd-standard
  zone: us-central1-a
```

* `type`: `pd-standard` or `pd-ssd`
* `zone`: GCE zone
* of course, the plugin will use some defaults when a parameter is omitted in a `StorageClass` instance (SSD in the same zone as in 1.3 ?).


No OpenStack/Cinder yet

@kubernetes/sig-storage
  • Loading branch information
Kubernetes Submit Queue authored Aug 18, 2016
2 parents e46e73a + 81ae9ef commit 7a26702
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions volume-provisioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ We propose that:
a match is found. The claim is `Pending` during this period.

4. With StorageClass instance, the controller finds volume plugin specified by
StorageClass.ProvisionerType.
StorageClass.Provisioner.

5. All provisioners are in-tree; they implement an interface called
`ProvisionableVolumePlugin`, which has a method called `NewProvisioner`
that returns a new provisioner.

6. The controller calls volume plugin `Provision` with ProvisionerParameters from the `StorageClass` configuration object.
6. The controller calls volume plugin `Provision` with Parameters from the `StorageClass` configuration object.

7. If `Provision` returns an error, the controller generates an event on the
claim and goes back to step 1., i.e. it will retry provisioning periodically
Expand Down Expand Up @@ -166,11 +166,11 @@ type StorageClass struct {
unversioned.TypeMeta `json:",inline"`
ObjectMeta `json:"metadata,omitempty"`

// ProvisionerType indicates the type of the provisioner.
ProvisionerType string `json:"provisionerType,omitempty"`
// Provisioner indicates the type of the provisioner.
Provisioner string `json:"provisioner,omitempty"`

// Parameters for dynamic volume provisioner.
ProvisionerParameters map[string]string `json:"provisionerParameters,omitempty"`
Parameters map[string]string `json:"parameters,omitempty"`
}

```
Expand Down Expand Up @@ -207,7 +207,7 @@ With the scheme outlined above the provisioner creates PVs using parameters spec
### Provisioner interface changes

`struct volume.VolumeOptions` (containing parameters for a provisioner plugin)
will be extended to contain StorageClass.ProvisionerParameters.
will be extended to contain StorageClass.Parameters.

The existing provisioner implementations will be modified to accept the StorageClass configuration object.

Expand All @@ -229,8 +229,8 @@ apiVersion: v1
kind: StorageClass
metadata:
name: aws-fast
provisionerType: kubernetes.io/aws-ebs
provisionerParameters:
provisioner: kubernetes.io/aws-ebs
parameters:
zone: us-east-1b
type: ssd
Expand All @@ -239,8 +239,8 @@ apiVersion: v1
kind: StorageClass
metadata:
name: aws-slow
provisionerType: kubernetes.io/aws-ebs
provisionerParameters:
provisioner: kubernetes.io/aws-ebs
parameters:
zone: us-east-1b
type: spinning
```
Expand Down

0 comments on commit 7a26702

Please sign in to comment.