Soru

Zorluk: Çok zorDeploying and Configuring Managed Database Instances

A cloud engineer needs to deploy a highly available Cloud SQL PostgreSQL instance using Private IP connectivity within a custom Virtual Private Cloud (VPC) network, followed by creating a cross-region read replica using the Google Cloud CLI. Arrange the required infrastructure provisioning and database creation steps in the correct chronological execution order from first to last.

  1. 1Reserve an internal IP address range in the custom VPC network with the purpose set to VPC_PEERING using `gcloud compute addresses create`.
  2. 2Establish a private services access connection between the custom VPC network and Google services using `gcloud services vpc-peerings connect`.
  3. 3Provision the primary Cloud SQL PostgreSQL instance with `--availability-type=REGIONAL`, `--no-assign-ip`, and `--network` bound to the custom VPC network using `gcloud sql instances create`.
  4. 4Deploy a read replica instance in a secondary region specifying the `--master-instance-name` flag using `gcloud sql instances create`.

Cevap

The correct sequence starts with reserving an internal IP allocation for VPC peering, establishing the private services access connection to servicenetworking.googleapis.com, creating the regional primary Cloud SQL instance attached to the VPC with public IP disabled, and finally creating the cross-region read replica targeting the primary instance.
Private IP connectivity for Cloud SQL relies on Private Services Access, which is built on VPC Peering between the customer VPC network and Google's internal service network. The workflow requires allocating an internal IP range (`gcloud compute addresses create ... --purpose=VPC_PEERING`), connecting the network to Service Networking (`gcloud services vpc-peerings connect`), provisioning the primary Cloud SQL instance (`gcloud sql instances create ... --no-assign-ip --network=...`), and finally creating any read replicas specifying the primary as the master instance.

Adım Adım Çözüm

1
Allocate a private IP range for Private Service Access.
An IP range with purpose VPC_PEERING is reserved in the target VPC network.
Google Cloud service networking requires a pre-allocated IP range to avoid subnet overlap prior to establishing peering.
2
Create the VPC peering connection for Google Managed Services.
The target VPC network is peered with the Service Networking tenant project network.
Cloud SQL Private IP uses Private Services Access, which relies on a underlying Service Networking VPC peering connection.
3
Provision the regional primary Cloud SQL database instance.
A high-availability primary database instance is deployed without a public IP.
The primary database instance must exist and be accessible via the peered network before replicas can be configured.
4
Provision the cross-region read replica.
A read replica is provisioned in the secondary region linked to the primary instance.
Read replicas depend on the primary instance ID specified by the master instance flag during creation.

Anahtar Kavram

Provisioning Cloud SQL instances with Private IP requires establishing a Private Services Access (Service Networking VPC Peering) connection before instantiating primary instances or read replicas.
Bu soruyu puanla