Skip to content

Commit

Permalink
fix(deployment): include cloud-sql auth proxy in migration job when n…
Browse files Browse the repository at this point in the history
…eeded (#300)

Signed-off-by: Christophe de Carvalho <christophe@archipelo.co>
  • Loading branch information
zaibon committed Aug 15, 2023
1 parent 6118412 commit 4cb7b0c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions deployment/chainloop/templates/controlplane/migrate-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,28 @@ spec:
securityContext:
{{- toYaml .Values.controlplane.podSecurityContext | nindent 8 }}
containers:
{{ if .Values.controlplane.sqlProxy.enabled }}
- name: cloud-sql-proxy
# It is recommended to use the latest version of the Cloud SQL proxy
# Make sure to update on a regular schedule!
image: gcr.io/cloudsql-docker/gce-proxy:1.28.0 # make sure the use the latest version
command:
- "/cloud_sql_proxy"
# 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"

# By default, the proxy will write all logs to stderr. In some
# environments, anything printed to stderr is consider an error. To
# disable this behavior and write all logs to stdout (except errors
# which will still go to stderr), use:
- "-log_debug_stdout"
- "-instances={{ .Values.controlplane.sqlProxy.connectionName }}=tcp:5432"
securityContext:
runAsNonRoot: true
resources:
{{- toYaml .Values.controlplane.sqlProxy.resources | nindent 12 }}
{{- end }}
- name: migrate
image: "{{ .Values.controlplane.migration.image.repository }}:{{ .Values.controlplane.migration.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.controlplane.image.pullPolicy }}
Expand Down

0 comments on commit 4cb7b0c

Please sign in to comment.