Issue
I’m trying to deploy a Google Cloud Platform (GCP) Postgres instance using private IPs into the same network (default
) as a Kubernetes cluster with IP Aliasing enabled. When I try to create a new Postgres instance, I get an error saying “Failed to create subnetwork. Couldn’t find free blocks in allocated IP ranges. Please allocate new ranges for this service provider.” I’ve tried to allocate more IP addresses in the VPC network details page, under the “Private service connection” tab, but I’m unsure how to make use of the new IP range without disrupting connections to existing services using an already created IP range.
Answer
The error message “Failed to create subnetwork. Couldn’t find free blocks in allocated IP ranges. Please allocate new ranges for this service provider.” indicates that there are no available IP addresses in the subnet for the new Postgres instance. To resolve this, you can do the following:
- Allocate a new IP range in the VPC network details page, under the “Private service connection” tab.
- Create a new subnet using the newly allocated IP range.
- Associate the new subnet with the Postgres instance.
To avoid disrupting connections to existing services that are using the already created IP range, you can create a new subnet with the newly allocated IP range and associate it with the Postgres instance. This way, existing services will not be affected.