diff --git a/docs/docs/provider-spec.md b/docs/docs/provider-spec.md index dd915fa6..9465f91d 100644 --- a/docs/docs/provider-spec.md +++ b/docs/docs/provider-spec.md @@ -521,6 +521,22 @@ the value zero will be omitted from the request because GCP client will not write any “empty” values to the request

+ + +storagePool + + + +*string + + + +(Optional) +

StoragePool in which the new disk is created. +You can provide this as a partial or full URL to the resource. For example +https://www.googleapis.com/compute/v1/projects/project/zones/zone

+ +
diff --git a/kubernetes/machine-class.yaml b/kubernetes/machine-class.yaml index 5cc02aba..fdb9fcf3 100644 --- a/kubernetes/machine-class.yaml +++ b/kubernetes/machine-class.yaml @@ -19,6 +19,7 @@ providerSpec: # kmsKeyServiceAccount: "id@project.iam.gserviceaccount.com" # email of service account (optional) # provisionedIops: 3000 # IOPS that the disk can handle (optional) # provisionedThroughput: 140 # throughput unit in MB per sec (optional) +# storagePool: projects//zones//storagePools/ # StoragePool where the new disk is created (optional). Can be passed as a partial or full URL to the resource labels: name: test-mc # Label assigned to the disk labels: diff --git a/pkg/api/v1alpha1/provider_spec.go b/pkg/api/v1alpha1/provider_spec.go index 0e4292e5..78399903 100644 --- a/pkg/api/v1alpha1/provider_spec.go +++ b/pkg/api/v1alpha1/provider_spec.go @@ -236,6 +236,12 @@ type GCPDisk struct { // the value zero will be omitted from the request because GCP client // will not write any "empty" values to the request ProvisionedThroughput int64 `json:"provisionedThroughput,omitempty"` + + // StoragePool in which the new disk is created. + // You can provide this as a partial or full URL to the resource. For example + // https://www.googleapis.com/compute/v1/projects/project/zones/zone + // +optional + StoragePool *string `json:"storagePool,omitempty"` } // GCPDiskEncryption holds references to encryption data diff --git a/pkg/gcp/machine_controller_util.go b/pkg/gcp/machine_controller_util.go index cc15aada..8de1adde 100644 --- a/pkg/gcp/machine_controller_util.go +++ b/pkg/gcp/machine_controller_util.go @@ -184,6 +184,7 @@ func createAttachedDisks(disks []*api.GCPDisk, zone, machineName string) []*comp SourceImage: disk.Image, ProvisionedIops: disk.ProvisionedIops, ProvisionedThroughput: disk.ProvisionedThroughput, + StoragePool: ptr.Deref(disk.StoragePool, ""), }, } }