Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

chore(cloud-sql): update GKE sample comments #10451

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

Merged
merged 4 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
19 changes: 17 additions & 2 deletions 19 cloud-sql/mysql/sqlalchemy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,19 @@ spec:
env:
- name: PORT
value: "8080"
# This project uses environment variables to determine
# how you would like to run your application
# To use the Python 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: "3306"
value: "3306"
# For Automatic IAM Authentication with the Python Connector
# use DB_IAM_USER instead of DB_USER (recommended)
# You may also remove the DB_PASS environment variable if
# you use Automatic IAM Authentication
- name: DB_USER
valueFrom:
secretKeyRef:
Expand All @@ -57,8 +66,10 @@ spec:
secretKeyRef:
name: <YOUR-DB-SECRET>
key: database
# If you are using the Python Connector (recommended), you can
# remove cloud-sql-proxy (everything below this line)
- name: cloud-sql-proxy
# This uses the latest version of the Cloud SQL proxy
# 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/cloud-sql-connectors/cloud-sql-proxy:latest
Expand All @@ -67,6 +78,10 @@ spec:
# following flag to have the proxy connect over private IP
# - "--private-ip"

# If you are not connecting with Automatic IAM, you can delete
# the following flag.
- "--auto-iam-authn"
Comment on lines +81 to +83
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just confirming you want this to be on by default? It conflicts with the advice above that using Automatic IAM is recommended but it's on by default here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this being on is fine, enabling it still allows users to connect via regular user and password authn, the flag just enables the additional ability for auto IAM authN and doesn't strictly force it.


# 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
Expand Down
17 changes: 16 additions & 1 deletion 17 cloud-sql/postgres/sqlalchemy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,19 @@ spec:
env:
- name: PORT
value: "8080"
# This project uses environment variables to determine
# how you would like to run your application
# To use the Python 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"
# For Automatic IAM Authentication with the Python Connector
# use DB_IAM_USER instead of DB_USER (recommended)
# You may also remove the DB_PASS environment variable if
# you use Automatic IAM Authentication
- name: DB_USER
valueFrom:
secretKeyRef:
Expand All @@ -57,6 +66,8 @@ spec:
secretKeyRef:
name: <YOUR-DB-SECRET>
key: database
# If you are using the Python Connector (recommended), you can
# remove cloud-sql-proxy (everything below this line)
- name: cloud-sql-proxy
# This uses the latest version of the Cloud SQL proxy
# It is recommended to use a specific version for production environments.
Expand All @@ -67,6 +78,10 @@ spec:
# following flag to have the proxy connect over private IP
# - "--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
Expand Down
6 changes: 6 additions & 0 deletions 6 cloud-sql/sql-server/sqlalchemy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ spec:
env:
- name: PORT
value: "8080"
# This project uses environment variables to determine
# how you would like to run your application
# To use the Python connector (recommended) - use INSTANCE_CONNECTION_NAME (proj:region:instance)
# To use TCP - Setting INSTANCE_HOST will use TCP (e.g., 127.0.0.1)
- name: INSTANCE_HOST
value: "127.0.0.1"
- name: DB_PORT
Expand All @@ -61,6 +65,8 @@ spec:
secretKeyRef:
name: <YOUR-DB-SECRET>
key: database
# If you are using the Python Connector (recommended), you can
# remove cloud-sql-proxy (everything below this line)
- name: cloud-sql-proxy
# This uses the latest version of the Cloud SQL proxy
# It is recommended to use a specific version for production environments.
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.