Hyeonkyu Han
Hyeonkyu Han

Reputation: 33

how can i access cloud sql from google kubernetes engine

At first i have delployed cloud sql with postgresql. and then i deployed gke with documents: https://cloud.google.com/support-hub#section-2 i used gcloud tool. and i made gke cluster using auto pilot mode. and made deployment with autoscaler. and i registered my docker image. and then i expose it with loadbalancer. Once i build my docker image. and then i excute it in local. it is running well. but it is not running well in gke server. and suddendly can not connect cloud sql. so i registered gke external ip in cloud sql connection ips. but it doesn't work... i want to connect cloud sql from google kubernetes engine. please help me...

Upvotes: 1

Views: 8749

Answers (2)

Shiva Matta
Shiva Matta

Reputation: 110

For accessing the Cloud SQL instance from an application running in Google Kubernetes Engine, you can use either the Cloud SQL Auth proxy (with public or private IP), or connect directly using a private IP address. The Cloud SQL Auth proxy is the recommended way to connect to Cloud SQL, even when using private IP.

Referral link :

[1] https://cloud.google.com/sql/docs/mysql/connect-kubernetes-engine [2]https://medium.com/google-cloud/connecting-cloud-sql-kubernetes-sidecar-46e016e07bb4 [3]https://www.jhipster.tech/tips/018_tip_kubernetes_and_google_cloud_sql.html

Upvotes: 6

kurtisvg
kurtisvg

Reputation: 3565

I recommend following the Connecting from Kubernetes page in the documentation.

Upvotes: 2

Related Questions