I have created a GCP CloudSQL
instance with a private address using Private Service Access
. I assigned the subnet mask (/20) for Private Service Access
and was able to successfully launch a MySQL instance
using this range. The following range was allocated by GCP for /20 subnet mask
$ gcloud compute addresses list --global --filter="purpose=VPC_PEERING"
NAME ADDRESS/RANGE TYPE PURPOSE NETWORK REGION SUBNET STATUS
google-managed-services-kube-shared-vpc 10.120.192.0/20 INTERNAL VPC_PEERING kube-shared-vpc RESERVED
After that I created the Private Connection
which is listed as shown below
$ gcloud services vpc-peerings list --network=kube-shared-vpc --project=training-network-dta-26a2
---
network: projects/957681968813/global/networks/kube-shared-vpc
peering: servicenetworking-googleapis-com
reservedPeeringRanges:
- google-managed-services-kube-shared-vpc
service: services/servicenetworking.googleapis.com
Now I allocated another private address range to Private Service Connection
as shown below
cloudsqlrange 192.168.0.0/24 INTERNAL VPC_PEERING kube-shared-vpc RESERVED
Following are my queries based on above setup
As I already created the
Private Connection
for this shared VPC how can I add the new IP range to this private connection or will it be automatically taken care of ?When I create a
CloudSQL
instance using 'Private IP" it is allocating IP address to theCloudSQL
instance from the first range I created . This is the IP range
NAME ADDRESS/RANGE TYPE PURPOSE NETWORK REGION SUBNET STATUS
google-managed-services-kube-shared-vpc 10.120.192.0/20 INTERNAL VPC_PEERING kube-shared-vpc RESERVED
I want to launch the CloudSQL
using the newly allocated IP Address Range. I cannot specify the IP as it is VPC Name
only which I can submit
gcloud beta sql instances create mysqlprivatetest \
--network=kube-shared-vpc \
--region us-central1 \
--no-assign-ip \
--tier=db-f1-micro \
--storage-type=HDD \
--require-ssl \
--database-version=MYSQL_8_0
Does this mean that only one IP Range is associated with a Private Service Connection
?
- Can we launch
Redis
instance using the same Private connection ?