Skip to content

Commit d3d0d1a

Browse files
Merge pull request #12 from giuseppealbrizio/development
update cloud sql gke config
2 parents 87b3205 + ce836c7 commit d3d0d1a

File tree

2 files changed

+22
-30
lines changed

2 files changed

+22
-30
lines changed

infra/k8s-dev/deployments/servicename-depl.yaml

+10-14
Original file line numberDiff line numberDiff line change
@@ -174,27 +174,23 @@ spec:
174174
- name: cloud-sql-proxy
175175
# It is recommended to use the latest version of the Cloud SQL proxy
176176
# Make sure to update on a regular schedule!
177-
image: gcr.io/cloudsql-docker/gce-proxy:1.28.0 # make sure the use the latest version
178-
command:
179-
- '/cloud_sql_proxy'
180-
177+
image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.1.0
178+
args:
181179
# If connecting from a VPC-native GKE cluster, you can use the
182180
# following flag to have the proxy connect over private IP
183-
# - "-ip_address_types=PRIVATE"
184-
185-
# By default, the proxy will write all logs to stderr. In some
186-
# environments, anything printed to stderr is consider an error. To
187-
# disable this behavior and write all logs to stdout (except errors
188-
# which will still go to stderr), use:
189-
- '-log_debug_stdout'
181+
# - "--private-ip"
190182

191-
# Replace DB_PORT with the port the proxy should listen on
183+
# Enable structured logging with LogEntry format:
184+
- "--structured-logs"
185+
192186
# Defaults: MySQL: 3306, Postgres: 5432, SQLServer: 1433
193-
- '-instances=instance-name=tcp:3306'
187+
# Replace DB_PORT with the port the proxy should listen on
188+
- "--port=3306"
189+
- "cloud-sql-instances=instance-name"
194190

195191
# [START cloud_sql_proxy_k8s_volume_mount]
196192
# This flag specifies where the service account key can be found
197-
- '-credential_file=/var/secrets/google/proxy-to-another-gcp-project.json'
193+
- '--credentials-file=/var/secrets/google/proxy-to-another-gcp-project.json'
198194
securityContext:
199195
# The default Cloud SQL proxy image runs as the
200196
# "nonroot" user and group (uid: 65532) by default.

infra/k8s/deployments/servicename-depl.yaml

+12-16
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ spec:
6161
- name: HOST
6262
value: '0.0.0.0'
6363
- name: SERVICE_NAME
64-
value: "your_service_name"
64+
value: 'your_service_name'
6565
- name: PORT
66-
value: "3000"
66+
value: '3000'
6767
- name: HASH
68-
value: "10"
68+
value: '10'
6969

7070
#JWT CONFIGURATION
7171
- name: JWT_KEY
@@ -206,27 +206,23 @@ spec:
206206
- name: cloud-sql-proxy
207207
# It is recommended to use the latest version of the Cloud SQL proxy
208208
# Make sure to update on a regular schedule!
209-
image: gcr.io/cloudsql-docker/gce-proxy:1.28.0 # make sure the use the latest version
210-
command:
211-
- '/cloud_sql_proxy'
212-
209+
image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.1.0
210+
args:
213211
# If connecting from a VPC-native GKE cluster, you can use the
214212
# following flag to have the proxy connect over private IP
215-
# - "-ip_address_types=PRIVATE"
213+
# - "--private-ip"
216214

217-
# By default, the proxy will write all logs to stderr. In some
218-
# environments, anything printed to stderr is consider an error. To
219-
# disable this behavior and write all logs to stdout (except errors
220-
# which will still go to stderr), use:
221-
- '-log_debug_stdout'
215+
# Enable structured logging with LogEntry format:
216+
- '--structured-logs'
222217

223-
# Replace DB_PORT with the port the proxy should listen on
224218
# Defaults: MySQL: 3306, Postgres: 5432, SQLServer: 1433
225-
- '-instances=mysql-instance-name=tcp:3306'
219+
# Replace DB_PORT with the port the proxy should listen on
220+
- '--port=3306'
221+
- 'cloud-sql-instances=instance-name'
226222

227223
# [START cloud_sql_proxy_k8s_volume_mount]
228224
# This flag specifies where the service account key can be found
229-
- '-credential_file=/var/secrets/google/proxy-to-another-gcp-project.json'
225+
- '--credentials-file=/var/secrets/google/proxy-to-another-gcp-project.json'
230226
securityContext:
231227
# The default Cloud SQL proxy image runs as the
232228
# "nonroot" user and group (uid: 65532) by default.

0 commit comments

Comments
 (0)