This page describes how to increase the IP address space available to the private services access configuration that AlloyDB uses for clusters and instances.
When you create an AlloyDB cluster or instance in a region that doesn't yet have any clusters or instances, AlloyDB creates a subnet in that region. If the existing IP address space available to AlloyDB is not large enough to create the subnet, your attempt to create the cluster or instance fails. You must increase the IP address space to resolve the address shortage before retrying to create the cluster or instance.
Before you begin
- The Google Cloud project you are using must have been enabled to access AlloyDB.
- You must have one of these IAM roles in the Google Cloud project you are using:
roles/alloydb.admin
(the AlloyDB Admin predefined IAM role)roles/owner
(the Owner basic IAM role)roles/editor
(the Editor basic IAM role)
If you don't have any of these roles, contact your Organization Administrator to request access.
- To increase the IP address range, you also must have these IAM
permissions:
compute.networks.list
compute.addresses.create
compute.addresses.list
servicenetworking.services.addPeering
Procedure
To increase the AlloyDB IP address space, you perform two operations:
- Create an additional allocated IP address range in your VPC network.
- Add the additional address range to the existing private services access connection in your VPC network.
Console
Go to the VPC networks page in the Google Cloud console.
Select the project where your VPC network resides.
Select the VPC network that contains your existing private services access connection.
Select the Private services access tab.
In the Private services access tab, select the Allocated IP ranges for services tab.
Click Allocate IP range.
Enter a Name and Description for the allocated range.
Specify an IP range for the allocation:
- To specify an IP address range, select Custom and then enter
a CIDR block, such as
192.168.0.0/16
. - To specify a prefix length and let Google select an available range,
select Automatic and then enter a prefix length, such as
16
.
- To specify an IP address range, select Custom and then enter
a CIDR block, such as
Click Allocate to create the allocated range.
In the Private service access tab, select the Private connections to services tab.
Click servicenetworking-googleapis-com.
In the Update a private connection dialog, click the Assigned allocation box and then select the additional allocated IP range you created earlier.
Click Update to update the connection.
gcloud
To use the gcloud CLI, you can install and initialize the Google Cloud CLI, or you can use Cloud Shell.
Use the
gcloud config set project
command to set the default project to the one where your VPC network resides.gcloud config set project PROJECT_ID
Where
PROJECT_ID
is the ID of the project where your VPC network resides.Use the
compute addresses create
command to create an additional allocated IP address range.To specify an address range and a prefix length (subnet mask), use the
addresses
andprefix-length
flags. For example, to allocate the CIDR block192.168.0.0/16
, specify192.168.0.0
for the address and16
for the prefix length.gcloud compute addresses create RESERVED_RANGE_NAME \ --global \ --purpose=VPC_PEERING \ --addresses=192.168.0.0 \ --prefix-length=16 \ --description="DESCRIPTION" \ --network=VPC_NETWORK
To specify just a prefix length (subnet mask), just use the
prefix-length
flag. When you omit the address range, Google Cloud automatically selects an unused address range in your VPC network. The following example selects an unused IP address range with a16
bit prefix length.gcloud compute addresses create RESERVED_RANGE_NAME \ --global \ --purpose=VPC_PEERING \ --prefix-length=16 \ --description="DESCRIPTION" \ --network=VPC_NETWORK
Replace the following placeholders with relevant values:
RESERVED_RANGE_NAME
: a name for the allocated range, such asadditional-alloydb-range
.DESCRIPTION
: a description for the range, such asallocated to extend AlloyDB range
.VPC_NETWORK
: the name of your VPC network, such asmy-vpc-network
.
The following example creates a private connection to Google so that the VM instances in the
default
VPC network can use private services access to reach Google services that support it.gcloud compute addresses create additional-alloydb-range \ --global \ --purpose=VPC_PEERING \ --prefix-length=16 \ --description="allocated to extend AlloyDB range" \ --network=default
Use the
services vpc-peerings list
command to get a list of IP ranges already allocated to your private services connection:gcloud services vpc-peerings list \ --service=servicenetworking.googleapis.com \ --network=VPC_NETWORK
Where
VPC_NETWORK
is the name of your VPC network, such asmy-vpc-network
.The list of IP ranges already allocated to your private services connection appears after
reservedPeeringRanges
.Use the
services vpc-peerings update
command to add the additional address range to the private services connection.gcloud services vpc-peerings update \ --service=servicenetworking.googleapis.com \ --ranges=RESERVED_RANGE_NAME,EXISTING_RANGES_LIST \ --network=VPC_NETWORK
Replace the following placeholders with relevant values:
RESERVED_RANGE_NAME
: the name of the additional allocated IP address range you created.EXISTING_RANGES_LIST
: a comma-separated list of the IP address ranges already allocated to the private services connection.VPC_NETWORK
: the name of your VPC network.
The command initiates a long-running operation, returning an operation name.
Check whether the operation was successful.
gcloud services vpc-peerings operations describe OPERATION_NAME
Replace
OPERATION_NAME
with the operation name that was returned from the previous step.