From e86710dbb56f4b366526191827ac99aa6b63df88 Mon Sep 17 00:00:00 2001 From: Jacob Keller Date: Tue, 27 Feb 2024 12:11:30 -0800 Subject: [PATCH] Explains that PVCs work if there's dynamic provisioning or pre-existing volumes. --- .../concepts/storage/dynamic-provisioning.md | 4 ++-- .../workloads/controllers/statefulset.md | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/content/en/docs/concepts/storage/dynamic-provisioning.md b/content/en/docs/concepts/storage/dynamic-provisioning.md index 903945f12b..4356e3d3d3 100644 --- a/content/en/docs/concepts/storage/dynamic-provisioning.md +++ b/content/en/docs/concepts/storage/dynamic-provisioning.md @@ -17,7 +17,8 @@ calls to their cloud or storage provider to create new storage volumes, and then create [`PersistentVolume` objects](/docs/concepts/storage/persistent-volumes/) to represent them in Kubernetes. The dynamic provisioning feature eliminates the need for cluster administrators to pre-provision storage. Instead, it -automatically provisions storage when it is requested by users. +automatically provisions storage when users create +[`PersistentVolumeClaim` objects](/docs/concepts/storage/persistent-volumes/). @@ -131,4 +132,3 @@ Zones in a Region. Single-Zone storage backends should be provisioned in the Zon Pods are scheduled. This can be accomplished by setting the [Volume Binding Mode](/docs/concepts/storage/storage-classes/#volume-binding-mode). - diff --git a/content/en/docs/concepts/workloads/controllers/statefulset.md b/content/en/docs/concepts/workloads/controllers/statefulset.md index b0176108ce..d7d60d5ded 100644 --- a/content/en/docs/concepts/workloads/controllers/statefulset.md +++ b/content/en/docs/concepts/workloads/controllers/statefulset.md @@ -44,7 +44,7 @@ that provides a set of stateless replicas. ## Limitations * The storage for a given Pod must either be provisioned by a - [PersistentVolume Provisioner](https://github.com/kubernetes/examples/tree/master/staging/persistent-volume-provisioning/README.md) + [PersistentVolume Provisioner](/docs/concepts/storage/dynamic-provisioning/) ([examples here](https://github.com/kubernetes/examples/tree/master/staging/persistent-volume-provisioning/README.md)) based on the requested `storage class`, or pre-provisioned by an admin. * Deleting and/or scaling a StatefulSet down will *not* delete the volumes associated with the StatefulSet. This is done to ensure data safety, which is generally more valuable than an @@ -141,10 +141,13 @@ validation error during StatefulSet creation. ### Volume Claim Templates -You can set the `.spec.volumeClaimTemplates` which can provide stable storage using -[PersistentVolumes](/docs/concepts/storage/persistent-volumes/) provisioned by a PersistentVolume -Provisioner. - +You can set the `.spec.volumeClaimTemplates` field to create a +[PersistentVolumeClaim](/docs/concepts/storage/persistent-volumes/). +This will provide stable storage to the StatefulSet if either +* The specified `storage class` is set up to use [dynamic + provisioning](/docs/concepts/storage/dynamic-provisioning/), or +* The cluster already contains a PersistentVolume with the correct `storage class` + and sufficient available storage space. ### Minimum ready seconds @@ -488,5 +491,4 @@ the `.spec.replicas` field automatically. Read the {{< api-reference page="workload-resources/stateful-set-v1" >}} object definition to understand the API for stateful sets. * Read about [PodDisruptionBudget](/docs/concepts/workloads/pods/disruptions/) and how - you can use it to manage application availability during disruptions. - + you can use it to manage application availability during disruptions. \ No newline at end of file