The issue targets an SQL scaling problem. For Cloud SQL Proxy there are options and one of them is one to specify instances through instance metadata with -instances_metadata option.
Despite -instances flag where we can specify a list of Cloud SQL instances connections names the -instances_metadata flag is not clear how to use.
Is that means that instance metadata works only for SQL instances that are on VMs? Because I don't understand how to add metadata to Cloud SQL Instance or fetch it by some way.
If there is no way to set or rely on Cloud SQL instance metadata that means that there is no way to scale Cloud SQL instances without proxy configuration update. Don't believe it's true. GC should support that.
Thank you for any advice.
Sorry, I can see how the name of the parameter can cause confusion. "instances_metadata" refers to metadata on GCE instances (VMs) that specifies Cloud SQL instances.
GCE allows you to add arbitrary key value pairs to VM metadata that processes on the VM can query and subscribe to listen for changes.
You can create a metadata entry on your VMs like "cloud_sql_instances" then specify
‑instances_metadata=cloud_sql_instances
. Now whenever that property changes, proxy will automatically pick those changes up.