Soru

Zorluk: ZorDeploying and Configuring Managed Database Instances

A cloud engineer is tasked with deploying a primary Cloud SQL for PostgreSQL database with Private IP connectivity inside a custom Virtual Private Cloud (VPC), along with a cross-region read replica. What is the correct sequence of administrative steps to provision this infrastructure?

  1. 1Allocate an internal IP address range in the VPC network using `gcloud compute addresses create` with `--purpose=VPC_PEERING`.
  2. 2Establish Private Services Access by peering the VPC network with Google services using `gcloud services vpc-peerings connect`.
  3. 3Create the primary Cloud SQL instance using `gcloud sql instances create` specifying `--no-assign-ip` and `--network`.
  4. 4Provision the read replica in the destination region using `gcloud sql instances create` with `--master-instance` referencing the primary instance.

Cevap

The correct sequence requires allocating an IP address range for VPC peering first, creating the private services connection between the VPC and Google services second, provisioning the primary Cloud SQL instance with private IP third, and creating the cross-region read replica last.
To deploy Cloud SQL using Private IP, Google Cloud mandates setting up Private Services Access (VPC Peering) first. This process requires allocating a named IP range (`--purpose=VPC_PEERING`) and creating the peering connection (`gcloud services vpc-peerings connect`). Once network connectivity is established, the primary Cloud SQL instance can be created with `--no-assign-ip` and connected to the VPC. Finally, the cross-region read replica is created by referencing the primary instance using `--master-instance`.

Adım Adım Çözüm

1
Allocate an IP range for Private Services Access
An IP block is explicitly reserved for VPC peering within the custom VPC.
Google services require a dedicated internal IP address range allocated within the host VPC prior to establishing service peering.
2
Create the Private Services Access connection
A VPC peering connection is established between the host VPC and Google's internal service producer network.
Cloud SQL private instances reside in a Google-managed VPC that communicates with the customer VPC via this peering connection.
3
Deploy the primary Cloud SQL instance with Private IP
The primary PostgreSQL database instance is provisioned with private network access only.
The primary instance must exist and be bound to the peered VPC network before any read replicas can connect to it.
4
Create the cross-region read replica
A secondary Cloud SQL instance is created in another region, replicating data from the primary instance.
The read replica creation command depends directly on the active primary database specified via `--master-instance`.

Anahtar Kavram

Configuring Cloud SQL Private IP Connectivity and Cross-Region Read Replicas
Tahmini Süre:2m 0s
Bu soruyu puanla