diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst index e0babd759..451f4bcd8 100644 --- a/doc/source/configuration.rst +++ b/doc/source/configuration.rst @@ -2088,7 +2088,8 @@ section of the configuration. .. attr:: volume-type :type: string - If given, the root volume type (``standard`` or ``ssd``). + If given, the root volume type (``pd-standard`` or + ``pd-ssd``). .. attr:: volume-size :type: int diff --git a/nodepool/driver/gce/adapter.py b/nodepool/driver/gce/adapter.py index c860412cc..782c61599 100644 --- a/nodepool/driver/gce/adapter.py +++ b/nodepool/driver/gce/adapter.py @@ -86,9 +86,13 @@ class GCEAdapter(SimpleTaskManagerAdapter): def createInstance(self, task_manager, hostname, metadata, label): image_id = self._getImageId(task_manager, label.cloud_image) + disk_init = dict(sourceImage=image_id, + diskType='zones/{}/diskTypes/{}'.format( + self.provider.zone, label.volume_type), + diskSizeGb=str(label.volume_size)) disk = dict(boot=True, autoDelete=True, - initializeParams=dict(sourceImage=image_id)) + initializeParams=disk_init) machine_type = 'zones/{}/machineTypes/{}'.format( self.provider.zone, label.instance_type) network = dict(network='global/networks/default', diff --git a/nodepool/driver/gce/config.py b/nodepool/driver/gce/config.py index e2e25d2fb..d26ab96e0 100644 --- a/nodepool/driver/gce/config.py +++ b/nodepool/driver/gce/config.py @@ -116,7 +116,7 @@ class ProviderPool(ConfigPool): cloud_image = None pl.cloud_image = cloud_image pl.instance_type = label['instance-type'] - pl.volume_type = label.get('volume-type', 'standard') + pl.volume_type = label.get('volume-type', 'pd-standard') pl.volume_size = label.get('volume-size', '10') full_config.labels[label['name']].pools.append(self) diff --git a/releasenotes/notes/add-google-cloud-35295a4cae5aaba7.yaml b/releasenotes/notes/add-google-cloud-35295a4cae5aaba7.yaml new file mode 100644 index 000000000..56cc31186 --- /dev/null +++ b/releasenotes/notes/add-google-cloud-35295a4cae5aaba7.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Support for resources in Google Compute Engine (GCE) has been added.