Skip to content

Commit

Permalink
fix: set pooler status globally
Browse files Browse the repository at this point in the history
  • Loading branch information
dabasvibhor committed Feb 21, 2024
1 parent 3b53f51 commit 25de3cd
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
4 changes: 2 additions & 2 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ spec:
- name: DB_URL
valueFrom:
secretKeyRef:
name: {{ if .Values.db.connectionPooler.enabled }}{{ .Values.db.connectionPooler.secretKeyRef.name }}{{ else }}{{ .Values.db.secretKeyRef.name }}{{ end }}
key: {{ if .Values.db.connectionPooler.enabled }}{{ .Values.db.connectionPooler.secretKeyRef.key }}{{ else }}{{ .Values.db.external.secretKeyRef.key }}{{ end }}
name: {{ if .Values.global.db.connectionPooler.enabled }}{{ .Values.db.connectionPooler.secretKeyRef.name }}{{ else }}{{ .Values.db.secretKeyRef.name }}{{ end }}
key: {{ if .Values.global.db.connectionPooler.enabled }}{{ .Values.db.connectionPooler.secretKeyRef.key }}{{ else }}{{ .Values.db.secretKeyRef.key }}{{ end }}
- name: PGRST_JWT_SECRET
valueFrom:
secretKeyRef:
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/pgbouncer.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.db.connectionPooler.enabled }}
{{- if .Values.global.db.connectionPooler.enabled }}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down
4 changes: 2 additions & 2 deletions chart/templates/postgrest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ spec:
- name: PGRST_DB_URI
valueFrom:
secretKeyRef:
name: {{ if .Values.db.connectionPooler.enabled }}{{ .Values.db.connectionPooler.secretKeyRef.name }}{{ else }}{{ .Values.db.secretKeyRef.name }}{{ end }}
key: {{ if .Values.db.connectionPooler.enabled }}{{ .Values.db.connectionPooler.secretKeyRef.key }}{{ else }}{{ .Values.db.external.secretKeyRef.key }}{{ end }}
name: {{ if .Values.global.db.connectionPooler.enabled }}{{ .Values.db.connectionPooler.secretKeyRef.name }}{{ else }}{{ .Values.db.secretKeyRef.name }}{{ end }}
key: {{ if .Values.global.db.connectionPooler.enabled }}{{ .Values.db.connectionPooler.secretKeyRef.key }}{{ else }}{{ .Values.db.secretKeyRef.key }}{{ end }}
- name: PGRST_JWT_SECRET
valueFrom:
secretKeyRef:
Expand Down
4 changes: 2 additions & 2 deletions chart/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{{- $postgresHost := (( get $secretData "POSTGRES_HOST" ) | b64dec ) | default (print "postgres." .Release.Namespace ".svc.cluster.local") }}

{{- define "app.db_host" -}}
{{- if .Values.db.connectionPooler.enabled }}
{{- if .Values.global.db.connectionPooler.enabled }}
{{- printf "%s-pgbouncer.%s.svc.cluster.local" (include "incident-commander.name" . ) .Release.Namespace }}
{{- else if .Values.db.create }}
{{- printf "postgres.%s.svc.cluster.local" .Release.Namespace }}
Expand Down Expand Up @@ -96,7 +96,7 @@ max_client_conn = 100
ignore_startup_parameters = extra_float_digits
{{- end -}}

{{- if .Values.db.connectionPooler.enabled }}
{{- if .Values.global.db.connectionPooler.enabled }}
apiVersion: v1
kind: Secret
metadata:
Expand Down
27 changes: 14 additions & 13 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ global:
tlsSecretName: ""
otel:
collector: ""
connectionPooler:
enabled: false
db:
connectionPooler:
enabled: true
serviceAccount:
# Annotations to add to the service account
annotations: {}
Expand Down Expand Up @@ -95,7 +96,7 @@ db:
name: incident-commander-postgrest-jwt
key: PGRST_JWT_SECRET
connectionPooler:
enabled: "{{ .Values.global.connectionPooler.enabled }}"
# enabled: ""
secretKeyRef:
name: mission-control-connection-pooler
key: DB_URL
Expand Down Expand Up @@ -125,11 +126,11 @@ canary-checker:
collector: "{{ .Values.global.otel.collector }}"
db:
runMigrations: false
connectionPooler:
enabled: "{{ .Values.global.connectionPooler.enabled }}"
# secretKeyRef:
# name: ""
# key: DB_URL
# connectionPooler:
# enabled: ""
# secretKeyRef:
# name: ""
# key: DB_URL
external:
enabled: true
create: false
Expand All @@ -145,11 +146,11 @@ config-db:
runMigrations: false
embedded:
persist: false
connectionPooler:
enabled: "{{ .Values.global.connectionPooler.enabled }}"
# secretKeyRef:
# name: ""
# key: DB_URL
# connectionPooler:
# enabled: ""
# secretKeyRef:
# name: ""
# key: DB_URL
external:
enabled: true
secretKeyRef:
Expand Down

0 comments on commit 25de3cd

Please sign in to comment.