Skip to content

Commit

Permalink
fix: make the chart db_url backward compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
dabasvibhor committed Feb 16, 2024
1 parent f16ed21 commit 53acb61
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 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: {{ .Values.db.urlSecretKeyRef.name }}
key: {{ .Values.db.urlSecretKeyRef.key }}
name: {{ .Values.db.secretKeyRef.name }}
key: {{ .Values.db.secretKeyRef.key }}
- name: PGRST_JWT_SECRET
valueFrom:
secretKeyRef:
Expand Down
11 changes: 10 additions & 1 deletion chart/templates/pgbouncer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ spec:
port: 5432
targetPort: 5432
---
apiVersion: v1
kind: Secret
metadata:
name: pgbouncer-config
type: Opaque
data:
pgbouncer.ini: W2RhdGFiYXNlc10NCm1pc3Npb25fY29udHJvbCA9IGhvc3Q9cG9zdGdyZXMubWlzc2lvbi1jb250cm9sLnN2Yy5jbHVzdGVyLmxvY2FsIHBvcnQ9NTQzMiBkYm5hbWU9bWlzc2lvbl9jb250cm9sDQoNCltwZ2JvdW5jZXJdDQpsaXN0ZW5fYWRkciA9IDAuMC4wLjANCmxpc3Rlbl9wb3J0ID0gNTQzMg0KdW5peF9zb2NrZXRfZGlyID0NCnVzZXIgPSBwb3N0Z3Jlcw0KYXV0aF9maWxlID0gL2V0Yy9wZ2JvdW5jZXIvdXNlcmxpc3QudHh0DQphdXRoX3R5cGUgPSBtZDUNCnBvb2xfbW9kZSA9IHRyYW5zYWN0aW9uDQptYXhfY2xpZW50X2Nvbm4gPSAxMDANCmlnbm9yZV9zdGFydHVwX3BhcmFtZXRlcnMgPSBleHRyYV9mbG9hdF9kaWdpdHMNCg0KIyBMb2cgc2V0dGluZ3MNCmFkbWluX3VzZXJzID0gcG9zdGdyZXM=
userlist.txt: InBvc3RncmVzIiAiVWVHSmNaRDBIQ2hBUmVEY0lLd2VvOEpodXptdmdyU2IiDQoiYXBwX3VzZXIiICJhcHBwYXNzd29yZCI=
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -39,7 +48,7 @@ spec:
- containerPort: 5432
env:
- name: AUTH_TYPE
value: trust
value: md5
- name: DB_HOST
valueFrom:
secretKeyRef:
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: {{ .Values.db.urlSecretKeyRef.name }}
key: {{ .Values.db.urlSecretKeyRef.key }}
name: {{ .Values.db.secretKeyRef.name }}
key: {{ .Values.db.secretKeyRef.key }}
- name: PGRST_JWT_SECRET
valueFrom:
secretKeyRef:
Expand Down
2 changes: 2 additions & 0 deletions chart/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ stringData:
POSTGRES_USER: {{ $user | quote }}
POSTGRES_PASSWORD: {{ $password | quote }}
POSTGRES_HOST: {{ $postgresHost | quote }}
PGBOUNCER_HOST: {{ (print (include "incident-commander.name" .) "-pgbouncer." .Release.Namespace ".svc.cluster.local") }}
POSTGRES_PORT: {{ $postgresPort | quote }}
SSLMODE: {{ $sslmode | quote }}
DB_URL: {{ (print "postgres://" $user ":" $password "@" $host "/mission_control?sslmode=" $sslmode ) | quote }}
DATABASE: {{ $database | quote }}
{{- end }}

Expand Down
6 changes: 3 additions & 3 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ canary-checker:
enabled: true
create: false
secretKeyRef:
name: incident-commander-db-url
name: incident-commander-postgres
key: DB_URL
flanksource-ui:
# Disable UI via canary-checker by default.
Expand All @@ -141,15 +141,15 @@ config-db:
external:
enabled: true
secretKeyRef:
name: incident-commander-db-url
name: incident-commander-postgres
key: DB_URL
apm-hub:
enabled: false
db:
enabled: false
secretKeyRef:
create: false
name: incident-commander-db-url
name: incident-commander-postgres
key: DB_URL
# Enable ingress only if the UI is deployed outside of the cluster and calls public incident-commander api endpoint.
ingress:
Expand Down

0 comments on commit 53acb61

Please sign in to comment.