|
| 1 | +# Hyperdisk Storage Pools User Guide |
| 2 | + |
| 3 | +Provisioning attached disks in Storage Pools is supported in the managed version of our driver which is automatically enabled on new GKE clusters, and in a manually deployed GCE PD CSI Driver. We recommend using this feature with the managed GCE PD CSI Driver. See the public documentation [here](https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/hyperdisk-storage-pools). |
| 4 | + |
| 5 | +If you would like to use Storage Pools with a manual deployment of the GCE PD CSI driver, you will need to do a couple additional things to enable the feature as described below. |
| 6 | + |
| 7 | +### Enabling Storage Pools for a Manual Deployment of GCE PD CSI driver. |
| 8 | + |
| 9 | +>**Attention:** Note that Storage Pools is only available in the driver version [v1.13.0+](https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/releases/tag/v1.13.0). |
| 10 | +
|
| 11 | +In addition to the install instructions [here](driver-install.md), you need to specify the CSI driver command line flags, `--enable-storage-pools=true`. |
| 12 | + |
| 13 | +### Provision Volumes in a Storage Pool |
| 14 | + |
| 15 | +To provision volumes in a Storage Pool, follow the instructions [here](https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/hyperdisk-storage-pools#provision-attached-disk). When using the feature in a manual deployment of the GCE PD CSI Driver, in the [Create a StorageClass](https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/hyperdisk-storage-pools#create-storageclass) section, you must additionally set [`allowedTopologies`](https://kubernetes.io/docs/concepts/storage/storage-classes/#allowed-topologies) to restrict the topology of provisioned volumes to specific zones where Storage Pools exist as specified in the `storage-pools` StorageClass parameter. |
| 16 | + |
| 17 | +For example, looking at the example in [Create a StorageClass](https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/hyperdisk-storage-pools#create-storageclass), assuming you already created a Storage Pool in `us-east4-c` according to [Create a Hyperdisk Storage Pool](https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/hyperdisk-storage-pools#create-sp), your `StorageClass` would need to specify `allowedTopologies` to restrict the topology of provisioned volumes to us-east4-c, where the Storage Pool exists. |
| 18 | + |
| 19 | + ```yaml |
| 20 | + apiVersion: storage.k8s.io/v1 |
| 21 | + kind: StorageClass |
| 22 | + metadata: |
| 23 | + name: storage-pools-sc |
| 24 | + provisioner: pd.csi.storage.gke.io |
| 25 | + volumeBindingMode: WaitForFirstConsumer |
| 26 | + allowVolumeExpansion: true |
| 27 | + parameters: |
| 28 | + type: hyperdisk-balanced |
| 29 | + provisioned-throughput-on-create: "140Mi" |
| 30 | + provisioned-iops-on-create: "3000" |
| 31 | + storage-pools: projects/my-project/zones/us-east4-c/storagePools/pool-us-east4-c |
| 32 | + allowedTopologies: |
| 33 | + - matchLabelExpressions: |
| 34 | + - key: topology.gke.io/zone |
| 35 | + values: |
| 36 | + - us-east4-c |
| 37 | + ``` |
0 commit comments