-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docs for implementing resize #5528
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,6 +109,39 @@ However, the particular path specified in the custom recycler pod template in th | |
|
||
For volume plugins that support the Delete reclaim policy, deletion removes both the `PersistentVolume` object from Kubernetes, as well as deleting the associated storage asset in the external infrastructure, such as an AWS EBS, GCE PD, Azure Disk, or Cinder volume. Volumes that were dynamically provisioned inherit the [reclaim policy of their `StorageClass`](#reclaim-policy-1), which defaults to Delete. The administrator should configure the `StorageClass` according to users' expectations, otherwise the PV must be edited or patched after it is created. See [Change the Reclaim Policy of a PersistentVolume](https://kubernetes.io/docs/tasks/administer-cluster/change-pv-reclaim-policy/). | ||
|
||
|
||
### Expanding Persistent Volumes Claims | ||
|
||
With Kubernetes 1.8, we have added Alpha support for expanding persistent volumes. The current Alpha support was designed to only support volume types | ||
that don't need file system resizing (Currently only glusterfs). | ||
|
||
Administrator can allow expanding persistent volume claims by setting `ExpandPersistentVolumes` feature gate to true. Administrator | ||
should also enable [`PersistentVolumeClaimResize` admission plugin](/docs/admin/admission-controllers/#persistentvolumeclaimresize) | ||
to perform additional validations of volumes that can be resized. | ||
|
||
Once `PersistentVolumeClaimResize` admission plug-in has been turned on, resizing will only be allowed for storage classes | ||
whose `allowVolumeExpansion` field is set to true. | ||
|
||
``` yaml | ||
kind: StorageClass | ||
apiVersion: storage.k8s.io/v1 | ||
metadata: | ||
name: gluster-vol-default | ||
provisioner: kubernetes.io/glusterfs | ||
parameters: | ||
resturl: "http://192.168.10.100:8080" | ||
restuser: "" | ||
secretNamespace: "" | ||
secretName: "" | ||
allowVolumeExpansion: true | ||
``` | ||
|
||
Once both feature gate and aforementioned admission plug-in are turned on, an user can request larger volume for their `PersistentVolumeClaim` | ||
by simply editing the claim and requesting bigger size. This in turn will trigger expansion of volume that is backing underlying `PersistentVolume`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would welcome some example here. Either with |
||
|
||
Under no circustances a new `PersistentVolume` gets created to satisfy the claim. Kubernetes will attempt to resize existing volume to satisfy the claim. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd add some note that progress of resize can be observed in |
||
|
||
## Types of Persistent Volumes | ||
|
||
`PersistentVolume` types are implemented as plugins. Kubernetes currently supports the following plugins: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider moving this to the
## PersistentVolumeClaims
section.This article has never touched the concept of
PersistentVolumeClaim
before that section.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, I disagree. Resizing is part of volume's lifecycle and concept of claim has already been introduced. For example from Reclaiming text that appears just above resizing doc:
"When a user is done with their volume, they can delete the PVC objects from the API which allows reclamation of the resource"
So surely users will know about persistent volume claims at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intent of this Alpha feature is about resizing/expanding persistent volumes, but it has to be done via an edit to the corresponding PersistentVolumeClaim. I still suggest we move it down to the PVC subsection so that the logic in this topic flows. But I may be wrong, so I won't insist.