github.com/shashidharatd/test-infra@v0.0.0-20171006011030-71304e1ca560/velodrome/mysql/README.md (about)

     1  Overview
     2  ========
     3  
     4  This deployment is used to set-up the Google Cloud SQL Proxy. The easiest way to
     5  access a Cloud SQL database is to use the proxy so that you connect to it, and
     6  it will redirect everything to the actual Cloud SQL database. This is secure and
     7  simple and uses the Service Account key to connect.
     8  
     9  You can get more info about the SQL database schema here: [../sql](../sql/)
    10  
    11  Set-up Google Cloud SQL Proxy
    12  =============================
    13  
    14  Create the database, from the console (recommended) or from command line:
    15  ```
    16  gcloud sql instances create github-database
    17  ```
    18  
    19  Create a new service account (with Editor role) and fetch its credentials, save
    20  it as "credential.json"
    21  https://cloud.google.com/storage/docs/authentication#service_accounts
    22  
    23  Create secret with the credentials:
    24  ```
    25  kubectl create secret generic service-account-token --from-file=credential.json
    26  ```
    27  
    28  Create secret for instances to listen to:
    29  ```
    30  kubectl create secret generic sqlproxy --from-literal=instances=${gcp_sql_project}:${zone}:github-database=tcp:0.0.0.0:3306
    31  ```