Get startedGet started for free

Using Cloud SQL and SQL Auth Proxy

1. Using Cloud SQL and SQL Auth Proxy

Cloud SQL is a fully managed database service that simplifies the process of setting up, maintaining, and scaling relational databases. Available for MySQL, PostgreSQL, and Microsoft SQL Server, Cloud SQL is designed to hand off mundane, but necessary and often time-consuming, tasks to Google—like applying patches and updates, managing backups, and configuring replications—so your focus can be on building great applications. And then there is the Cloud SQL Auth Proxy, which is a tool designed to streamline and secure connections to your Cloud SQL database instances. It acts as a middleman between your application and your database, eliminating the need to manage complex network configurations or expose your database directly to the internet. In-transit traffic is automatically encrypted, and authentication is handled with SQL. All Pods that compose your application can reliably access the database, even if they're dynamic. In GKE, Cloud SQL Auth Proxy is set up as a “sidecar” container in the same Pod that contains your application. Your application can communicate with the Cloud SQL Auth Proxy container using the localhost network address. To complete this setup, you'll first need to enable the necessary API. This includes Cloud SQL API, and sqladmin API. Next, create an IAM service account. And third, use Workload Identity to link the IAM service account to a Kubernetes service account. Be sure to use Secrets to securely provide credentials to your Pods.

2. Let's practice!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.