Accessing CDF Metadata in CloudSQL
This article covers how to access the CloudSQL instance in a CDF tenant project that contains all metadata that CDF needs to operate.
If the CDF instance is private, you should follow the instructions in this article to create a support VM and connect to it.
Ensure that your kubectl is connected to the GKE cluster of the desired instance.
Install postgres sql CLI. If you're using a support-vm:
sudo yum install postgresql
Â
Export the following variables if you haven't already done so from step 1:
export TP=<tenant_project_id> export INSTANCE=<cdf_instance_name>
Â
Get the CloudSQL instance IP address by running the following command and copying the PRIVATE_ADDRESS column into the export command:
gcloud sql instances list --project $TP --filter="name~$INSTANCE*" export IP_ADDRESS=<result_from_command>
Â
Get the CloudSQL instance password by running the following commands and copying the value.
Â
Connect to the database. When promoted for the password, paste the value obtained from step 6.
Â
You are now connected to the database. Run
\dt+
to get a summary of the tables in the database.
Â
Â
Â
Â