Soru

Zorluk: ZorDeploying and Configuring Managed Database Instances

A Cloud Engineer is tasked with provisioning a Cloud SQL for MySQL database instance that must communicate exclusively using a Private IP address within an existing custom VPC network named `prod-vpc`. Security policy strictly prohibits assigning public IP addresses. In what order should the engineer execute the configuration and deployment steps to establish Private Service Access and successfully create the database instance?

  1. 1Allocate an IP address range for Private Service Access in `prod-vpc` using the `gcloud compute addresses create` command with `--purpose=VPC_PEERING`.
  2. 2Establish a private service connection between `prod-vpc` and Google services using the `gcloud services vpc-peerings connect` command.
  3. 3Deploy the Cloud SQL instance using `gcloud sql instances create` with the `--network=prod-vpc` and `--no-assign-ip` flags.
  4. 4Create the application database schema container using the `gcloud sql databases create` command.

Cevap

The correct sequence begins with allocating an IP address range for VPC peering, followed by establishing the private service connection, then creating the Cloud SQL instance with `--no-assign-ip`, and finally creating the database on the instance.
Configuring Cloud SQL with Private IP requires establishing a Private Service Access connection first. This is a prerequisite two-step process: allocating an IP range (`gcloud compute addresses create ... --purpose=VPC_PEERING`) and creating the peering connection (`gcloud services vpc-peerings connect`). Only after this network foundation is in place can the instance be created with `--network` and `--no-assign-ip`. Logical database creation follows instance provisioning.

Adım Adım Çözüm

1
Reserve internal IP allocation
A named IP block is allocated for VPC Peering within the target VPC network.
Cloud SQL Private IP relies on Service Networking, which requires an explicit IP allocation before establishing the peering connection.
2
Connect the VPC network to Service Networking
VPC Network Peering is configured between the user's VPC and Google's service producer VPC.
This step provisions the underlying network routing infrastructure necessary for Google-managed database instances to receive internal IP addresses.
3
Provision the Cloud SQL instance
The Cloud SQL instance is deployed with a private IP address and no public IP.
The Cloud SQL instance deployment command verifies that Private Service Access has been configured for the specified VPC network.
4
Create the database inside the instance
The target database schema is instantiated within the active Cloud SQL instance.
Databases are logical objects housed within a database instance and can only be created after instance deployment completes.

Anahtar Kavram

Deploying Cloud SQL with Private IP via Private Service Access
Bu soruyu puanla