Skip to content

Added an sql proxy sidecontainer #182

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions helm/prenet-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ persistence:
storageClass: ""
size: 20Gi

# externalServiceAccount: "prenet"

extraEnvVars:
- name: LOG_LEVEL
value: "DEBUG"
Expand Down
27 changes: 27 additions & 0 deletions helm/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ spec:
{{- end }}
{{- end }}
spec:
{{- if .Values.externalServiceAccount}}
serviceAccount: {{ .Values.externalServiceAccount }}
{{- end }}
{{- if .Values.affinity }}
affinity: {{- include "polybase.render" (dict "value" .Values.affinity "context" $) | nindent 8 }}
{{- else }}
Expand Down Expand Up @@ -165,6 +168,30 @@ spec:
{{- if .Values.extraVolumeMounts }}
{{- include "polybase.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}

#cloud-sql-proxy
{{- if .Values.cloudsql.enabled }}
- name: {{ include "polybase.name" . }}-sql-proxy
args:
{{- if .Values.cloudsql.credentialFile }}
- --credentials-file={{ .Values.cloudsql.credentialFile }}
{{- end }}
{{- if .Values.cloudsql.usePrivateIP }}
- --private-ip
{{- end }}
- --max-sigterm-delay={{ .Values.cloudsql.timeout | default "30s" }}
- "polybase-{{ .Values.env }}:{{ .Values.cloudsql.region }}:{{ .Values.cloudsql.db_instance }}"
image: {{ .Values.cloudsql.image }}:{{ .Values.cloudsql.tag }}
imagePullPolicy: IfNotPresent
securityContext:
{{- toYaml .Values.cloudsql.securityContext | nindent 12 }}
resources:
{{- toYaml .Values.cloudsql.resources | nindent 12 }}
{{- if .Values.cloudsql.volumesFromSecrets }}
volumeMounts:
{{ include "secret.container.mounts" .Values.cloudsql | indent 12 }}
{{- end }}
{{- end }}
volumes:
- name: scripts-vol
configMap:
Expand Down
26 changes: 24 additions & 2 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,30 @@ serviceAccount:
##
automountServiceAccountToken: true

## @section Traffic Exposure Parameters
##
## @section Cloud SQL Proxy
cloudsql:
enabled: false
usePrivateIP: true
resources:
limits:
cpu: 500m
memory: 500Mi
requests:
cpu: 100m
memory: 100Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
image: gcr.io/cloud-sql-connectors/cloud-sql-proxy
tag: "2.6.0"
region: us-central1
db_instance: polybase
credentialFile: "/path/to/credentials.json"
volumesFromSecrets: []

## Polybase service parameters
##
Expand Down