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.

  1. If the CDF instance is private, you should follow the instructions in this article to create a support VM and connect to it.

  2. Ensure that your kubectl is connected to the GKE cluster of the desired instance.

  3. Install postgres sql CLI. If you're using a support-vm:

    sudo yum install postgresql

     

  4. Export the following variables if you haven't already done so from step 1:

    export TP=<tenant_project_id> export INSTANCE=<cdf_instance_name>

     

  5. 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>

     

  6. Get the CloudSQL instance password by running the following commands and copying the value.

     

  7. Connect to the database. When promoted for the password, paste the value obtained from step 6.

     

  8. You are now connected to the database. Run \dt+ to get a summary of the tables in the database.

 

 

 

Â