Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cloud-sql): update Cloud SQL Proxy to v2 in GKE samples #3350

Merged
merged 5 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions cloud-sql/mysql/mysql/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,21 @@ spec:
# This uses the latest version of the Cloud SQL proxy
# It is recommended to use a specific version for production environments.
# See: https://github.com/GoogleCloudPlatform/cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:latest
command:
- "/cloud_sql_proxy"

image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:latest
args:
# If connecting from a VPC-native GKE cluster, you can use the
# following flag to have the proxy connect over private IP
# - "-ip_address_types=PRIVATE"
# - "--private-ip"

# If you are not connecting with Automatic IAM, you can delete
# the following flag.
- "--auto-iam-authn"

# tcp should be set to the port the proxy should listen on
# and should match the DB_PORT value set above.
# Defaults: MySQL: 3306, Postgres: 5432, SQLServer: 1433
- "-instances=<INSTANCE_CONNECTION_NAME>=tcp:3306"
- "--port=3306"
- "<INSTANCE_CONNECTION_NAME>"
securityContext:
# The default Cloud SQL proxy image runs as the
# "nonroot" user and group (uid: 65532) by default.
Expand Down
25 changes: 18 additions & 7 deletions cloud-sql/postgres/knex/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,18 @@ spec:
env:
- name: PORT
value: "8080"
# This project uses environment variables to determine
# how you would like to run your application
# To use the Node.js connector (recommended) - use INSTANCE_CONNECTION_NAME (proj:region:instance)
# To use TCP - Setting INSTANCE_HOST will use TCP (e.g., 127.0.0.1)
# To use Unix, use INSTANCE_UNIX_SOCKET (e.g., /cloudsql/proj:region:instance)
- name: INSTANCE_HOST
value: "127.0.0.1"
- name: DB_PORT
value: "5432"
value: "5432"
# To use Automatic IAM Authentication (recommended)
# use DB_IAM_USER instead of DB_USER
# you may also remove the DB_PASS environment variable
- name: DB_USER
valueFrom:
secretKeyRef:
Expand All @@ -61,18 +69,21 @@ spec:
# This uses the latest version of the Cloud SQL proxy
# It is recommended to use a specific version for production environments.
# See: https://github.com/GoogleCloudPlatform/cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:latest
command:
- "/cloud_sql_proxy"

image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:latest
args:
# If connecting from a VPC-native GKE cluster, you can use the
# following flag to have the proxy connect over private IP
# - "-ip_address_types=PRIVATE"
# - "--private-ip"

# If you are not connecting with Automatic IAM, you can delete
# the following flag.
- "--auto-iam-authn"

# tcp should be set to the port the proxy should listen on
# and should match the DB_PORT value set above.
# Defaults: MySQL: 3306, Postgres: 5432, SQLServer: 1433
- "-instances=<INSTANCE_CONNECTION_NAME>=tcp:5432"
- "--port=5432"
- "<INSTANCE_CONNECTION_NAME>"
securityContext:
# The default Cloud SQL proxy image runs as the
# "nonroot" user and group (uid: 65532) by default.
Expand Down
11 changes: 5 additions & 6 deletions cloud-sql/sqlserver/mssql/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,17 @@ spec:
# This uses the latest version of the Cloud SQL proxy
# It is recommended to use a specific version for production environments.
# See: https://github.com/GoogleCloudPlatform/cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:latest
command:
- "/cloud_sql_proxy"

image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:latest
args:
# If connecting from a VPC-native GKE cluster, you can use the
# following flag to have the proxy connect over private IP
# - "-ip_address_types=PRIVATE"
# - "--private-ip"

# tcp should be set to the port the proxy should listen on
# and should match the DB_PORT value set above.
# Defaults: MySQL: 3306, Postgres: 5432, SQLServer: 1433
- "-instances=<INSTANCE_CONNECTION_NAME>=tcp:1433"
- "--port=1433"
- "<INSTANCE_CONNECTION_NAME>"
securityContext:
# The default Cloud SQL proxy image runs as the
# "nonroot" user and group (uid: 65532) by default.
Expand Down
Loading