Skip to content

Commit 5f63fba

Browse files
fix: add references to sslmode for postgres dbs
[REL-638](https://linear.app/sourcegraph/issue/REL-638/configure-aws-rds-databases-for-tls-connections-in-helm-chart) raised issues that this flag did not get mentioned in the docs where a customer wanted to use TLS. It also outlined the recommended fixes that this commit implements.
1 parent e215bde commit 5f63fba

File tree

7 files changed

+21
-1
lines changed

7 files changed

+21
-1
lines changed

charts/sourcegraph-migrator/templates/_helpers.tpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,9 @@ useGlobalTagAsDefault configuration
9191
secretKeyRef:
9292
key: user
9393
name: {{ $secretName }}
94+
- name: {{ printf "%sSSLMODE" $prefix }}
95+
valueFrom:
96+
secretKeyRef:
97+
key: sslmode
98+
name: {{ $secretName }}
9499
{{- end }}

charts/sourcegraph/examples/external-databases/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ data:
3030
password: ""
3131
port: ""
3232
user: ""
33+
pgsslmode: "require" # optional, enable if using SSL
3334
```
3435
3536
The Secret name should be set in your override file in the `auth.existingSecret` key for each database. See the [override.yaml] for an example.

charts/sourcegraph/templates/_helpers.tpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ app.kubernetes.io/name: jaeger
211211
secretKeyRef:
212212
key: user
213213
name: {{ $secretName }}
214+
- name: {{ printf "%sSSLMODE" $prefix }}
215+
valueFrom:
216+
secretKeyRef:
217+
key: sslmode
218+
name: {{ $secretName }}
214219
{{- if eq $service "grafana" }}
215220
- name: {{ printf "%sSSLMODE" $prefix }}
216221
valueFrom:

charts/sourcegraph/templates/codeinsights-db/codeinsights-db.Secret.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ data:
1414
password: {{ .Values.codeInsightsDB.auth.password | toString | b64enc | quote }}
1515
port: {{ .Values.codeInsightsDB.auth.port | toString | b64enc | quote }}
1616
user: {{ .Values.codeInsightsDB.auth.user | toString | b64enc | quote }}
17+
sslmode: {{ .Values.codeInsightsDB.auth.sslmode | toString | b64enc | quote }}
1718
{{- end -}}

charts/sourcegraph/templates/codeintel-db/codeintel-db.Secret.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ data:
1414
password: {{ .Values.codeIntelDB.auth.password | toString | b64enc | quote }}
1515
port: {{ .Values.codeIntelDB.auth.port | toString | b64enc | quote }}
1616
user: {{ .Values.codeIntelDB.auth.user | toString | b64enc | quote }}
17+
sslmode: {{ .Values.codeIntelDB.auth.sslmode | toString | b64enc | quote }}
1718
{{- end -}}

charts/sourcegraph/templates/pgsql/pgsql.Secret.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ data:
1414
password: {{ .Values.pgsql.auth.password | toString | b64enc | quote }}
1515
port: {{ .Values.pgsql.auth.port | toString | b64enc | quote }}
1616
user: {{ .Values.pgsql.auth.user | toString | b64enc | quote }}
17+
sslmode: {{ .Values.pgsql.auth.sslmode | toString | b64enc | quote }}
1718
{{- end -}}

charts/sourcegraph/values.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ codeInsightsDB:
164164
password: "password"
165165
# -- Sets codeinsights-db port
166166
port: "5432"
167+
# -- Sets codeinsights-db SSL mode
168+
sslmode: "disable" # set to "require" to enable SSL
167169
# -- Environment variables for the `codeinsights-db` container
168170
env: {}
169171
# -- Name of existing ConfigMap for `codeinsights-db`. It must contain a `postgresql.conf` key.
@@ -237,6 +239,8 @@ codeIntelDB:
237239
password: "password"
238240
# -- Sets codeintel-db port
239241
port: "5432"
242+
# -- Sets codeintel-db SSL mode
243+
sslmode: "disable" # set to "require" to enable SSL
240244
# -- Name of existing ConfigMap for `codeintel-db`. It must contain a `postgresql.conf` key
241245
existingConfig: ""
242246
# -- Additional PostgreSQL configuration. This will override or extend our default configuration.
@@ -721,8 +725,10 @@ pgsql:
721725
password: "password"
722726
# -- Sets postgres port
723727
port: "5432"
728+
# -- Sets postgres SSL mode
729+
sslmode: "disable" # set to "require" to enable SSL
724730
# -- Name of existing ConfigMap for `pgsql`. It must contain a `postgresql.conf` key
725-
existingConfig: "" # Name of an existing configmap
731+
existingConfig: "" # Name of an existing configmap
726732
# -- Additional PostgreSQL configuration. This will override or extend our default configuration.
727733
# Notes: This is expecting a multiline string.
728734
# Learn more from our [recommended PostgreSQL configuration](https://docs.sourcegraph.com/admin/config/postgres-conf) and [PostgreSQL documentation](https://www.postgresql.org/docs/12/config-setting.html)

0 commit comments

Comments
 (0)