This page describes how to create a read pool instance in an AlloyDB cluster.
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.
Procedure
Console
In the Google Cloud console, go to the Clusters page.
Click a cluster in the Resource Name column.
Go to the Instances in your cluster section, and click Add read pool.
Configure your read pool instance:
In the Read pool instance ID field, enter an ID for the read pool instance.
In the Node count field, enter a node count.
The number of nodes in a read pool instance determines the instance's overall computing capacity.
Note that you can have a maximum of 20 nodes across all the read pool instances in a cluster.
Select a machine type.
Optional: Set custom flags to your instance. For each flag:
- Click Add flag.
- Select a flag from the New database flag list.
- Provide a value for the flag.
- Click Done.
Click Add read pool.
gcloud
To use the gcloud CLI, you can install and initialize the Google Cloud CLI, or you can use Cloud Shell.
Use the gcloud alloydb instances create
command to create a read pool instance.
gcloud alloydb instances create INSTANCE_ID \
--instance-type=READ_POOL \
--cpu-count=CPU_COUNT \
--read-pool-node-count=NODE_COUNT \
--region=REGION_ID \
--cluster=CLUSTER_ID \
--project=PROJECT_ID
Replace the following:
INSTANCE_ID
: The ID of the instance you are creating. It must begin with a lowercase letter and can contain lowercase letters, numbers, and hyphens.CPU_COUNT
: The number of vCPUs you want for the instance. Valid values include:2
: 2 vCPUs, 16 GB RAM4
: 4 vCPUs, 32 GB RAM8
: 8 vCPUs, 64 GB RAM16
: 16 vCPUs, 128 GB RAM32
: 32 vCPUs, 256 GB RAM64
: 64 vCPUs, 512 GB RAM96
: 96 vCPUs, 768 GB RAM128
: 128 vCPUs, 864 GB RAM
NODE_COUNT
: The number of nodes in the instance. Specify a number1
through20
, inclusive. Note that you cannot have more than 20 nodes across all read pool instances in a cluster.REGION_ID
: The region where you want the instance placed.CLUSTER_ID
: The ID of the cluster where you want the instance placed.PROJECT_ID
: The ID of the project where the cluster is placed.
To create a read pool instance for a Private Service Connect-enabled cluster, add the --allowed-psc-projects
flag to set a comma separated list of project IDs or project numbers that you want to allow access to the instance—for example, my-project-1
, 12345
,my-project-n
.
gcloud alloydb instances create INSTANCE_ID \
--instance-type=READ_POOL \
--cpu-count=CPU_COUNT \
--region=REGION_ID \
--cluster=CLUSTER_ID \
--project=PROJECT_ID \
--allowed-psc-projects=ALLOWED_PROJECT_LIST
Replace the following:
ALLOWED_PROJECT
(Optional): The comma separated list of project IDs or project numbers that you want to allow access to the instance—for example,my-project-1
,12345
,my-project-n
. You must set a list of allowed projects or numbers, if your cluster is using Private Service Connect as the method of connecting to the instance.
To create a read pool instance for a public IP-enabled cluster, add the --assign-inbound-public-ip=ASSIGN_IPV4
parameter.
gcloud alloydb instances create INSTANCE_ID \
--instance-type=READ_POOL \
--cpu-count=CPU_COUNT \
--region=REGION_ID \
--cluster=CLUSTER_ID \
--project=PROJECT_ID \
--assign-inbound-public-ip=ASSIGN_IPV4
Optionally, to can pass the comma separated list of CIDR blocks, such as 64.233.160.0/16
to the --authorized-external-networks
parameter to set authorized external networks on your instance.