Provisioning regional Persistent Disks

This page explains how to enable dynamic provisioning of Regional Persistent Disks and how to provision them manually.

Regional Persistent Disks

As with regular persistent disks, regional persistent disks can be dynamically provisioned as needed or manually provisioned in advance by the cluster administrator.

Dynamic provisioning

To enable dynamic provisioning of regional persistent disks, create a StorageClass with the replication-type and zones parameters. For example, the following manifest describes a StorageClass that uses standard persistent disks and that replicates data to the europe-west1-b and europe-west1-c zones:

kind: StorageClass
  name: regionalpd-storageclass
  type: pd-standard
  replication-type: regional-pd
  zones: europe-west1-b, europe-west1-c

To create a PersistentVolumeClaim named "regional-pvc" with the regionalpd-storageclass StorageClass, refer to the StorageClass in the claim's manifest:

apiVersion: v1
kind: PersistentVolumeClaim
  name: regional-pvc
  namespace: testns
    - ReadWriteOnce
      storage: 200Gi
  storageClassName: regionalpd-storageclass

Manual provisioning

First, create a regional persistent disk. The following example creates a disk named "gce-disk-1" replicated to the europe-west1-b and europe-west1-c zones:

gcloud beta compute disks create \
 gce-disk-1 \
 --region europe-west1 \
 --replica-zones europe-west1-b,europe-west1-c

You can then create a PersistentVolume that references the regional persistent disk, following the procedure described here.

Kubernetes automatically adds a label to PersistentVolume objects that are backed by a regional persistent disk. The label's key is and its value is the two zones where the persistent disks are located. For example, a PersistentVolume that is backed by regional persistent disk that replicates data to europe-west1-b and europe-west1-c has this label added to it: “europe-west1-b__europe-west1-c”

Naming persistent disks

Kubernetes cannot distinguish between zonal and regional persistent disks with the same name. As a workaround, ensure that persistent disks have unique names. This issue does not occur when using dynamically provisioned PDs.

هل كانت هذه الصفحة مفيدة؟ يرجى تقييم أدائنا:

إرسال تعليقات حول...

Kubernetes Engine Documentation