Skip to content

Commit

Permalink
feat: cloud-sql-proxy 2.0.0 and metrics support (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmymy authored Feb 21, 2023
1 parent 77ba60f commit e7f51df
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
3 changes: 2 additions & 1 deletion catalog/sql/auth-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Launch a Cloud SQL Auth proxy instance as a DaemonSet in Kubernetes
| connection-name | example-connection | str | 1 |
| daemonset-name | cloud-sql-auth-proxy | str | 4 |
| namespace | default | str | 1 |
| project-id | | str | 2 |
| project-id | | str | 3 |
| service-account-name | cloud-sql-proxy-sa | str | 2 |
| service-name | cloud-sql-auth-proxy | str | 1 |
| servie-account-name | cloud-sql-auth-proxy | str | 1 |
Expand All @@ -29,6 +29,7 @@ This package has no sub-packages.
|---------------------|-----------------------------------|-------------------|--------------------------------------|-----------|
| daemonset.yaml | apps/v1 | DaemonSet | cloud-sql-auth-proxy | default |
| iam.yaml | iam.cnrm.cloud.google.com/v1beta1 | IAMPolicyMember | iam-member-cloud-sql | default |
| iam.yaml | iam.cnrm.cloud.google.com/v1beta1 | IAMPolicyMember | iam-member-cloudsql-metrics | default |
| iam.yaml | iam.cnrm.cloud.google.com/v1beta1 | IAMServiceAccount | cloud-sql-auth-proxy | default |
| iam.yaml | iam.cnrm.cloud.google.com/v1beta1 | IAMPolicy | iampolicy-cloud-sql-workloadidentity | default |
| service.yaml | v1 | Service | cloud-sql-auth-proxy | default |
Expand Down
5 changes: 2 additions & 3 deletions catalog/sql/auth-proxy/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ spec:
serviceAccountName: cloud-sql-proxy-sa # kpt-set: ${service-account-name}
containers:
- name: gce-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.33.0
command: ["/cloud_sql_proxy"]
args: ["-instances=$(CONNECTION_NAME)=tcp:0.0.0.0:5432", "-ip_address_types=PRIVATE", "-log_debug_stdout=true", "-verbose=false"]
image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.0.0
args: ["$(CONNECTION_NAME)", '--address=0.0.0.0', "--private-ip", "--structured-logs"]
env:
- name: CONNECTION_NAME
value: "example-connection" # kpt-set: ${connection-name}
Expand Down
16 changes: 16 additions & 0 deletions catalog/sql/auth-proxy/iam.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ spec:
external: projects/example-project # kpt-set: projects/${project-id}
---
apiVersion: iam.cnrm.cloud.google.com/v1beta1
kind: IAMPolicyMember
metadata:
name: iam-member-cloudsql-metrics
namespace: default
annotations:
cnrm.cloud.google.com/blueprint: cnrm/sql/auth-proxy/v0.1.0
spec:
memberFrom:
serviceAccountRef:
name: cloud-sql-auth-proxy
role: roles/monitoring.metricWriter
resourceRef:
kind: Project
external: projects/example-project # kpt-set: projects/${project-id}
---
apiVersion: iam.cnrm.cloud.google.com/v1beta1
kind: IAMServiceAccount
metadata:
name: cloud-sql-auth-proxy
Expand Down

0 comments on commit e7f51df

Please sign in to comment.