Skip to content

Commit

Permalink
Merge pull request #672 from oliver-hofmann-cistec-com/main
Browse files Browse the repository at this point in the history
add the option to define the sslMode for the database connection
  • Loading branch information
pothos authored Mar 7, 2024
2 parents 4519d93 + 23ff5eb commit ae64521
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions charts/nebraska/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ $ helm install my-nebraska nebraska/nebraska
| `config.auth.oidc.sessionCryptKey` | Session key used for encrypting sessions in cookies to store OIDC info, will be generated if none is passed | `nil` |
| `config.database.host` | The host name of the database server | `""` (use postgresql from Bitnami subchart) |
| `config.database.port` | The port number the database server is listening on | `5432` |
| `config.database.sslMode` | The mode of the database connection | `disable` |
| `config.database.dbname` | The database name | `{{ .Values.postgresql.auth.database }}` (evaluated as a template) |
| `config.database.username` | PostgreSQL user | `{{ .Values.postgresql.postgresqlUsername }}` (evaluated as a template) |
| `config.database.password` | PostgreSQL user password | `""` (evaluated as a template) |
Expand Down
3 changes: 2 additions & 1 deletion charts/nebraska/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{- $db := ( tpl .Values.config.database.dbname . ) }}
{{- $host := .Values.config.database.host | default (include "nebraska.postgresql.fullname" .) }}
{{- $port := .Values.config.database.port | toString }}
{{- $sslMode := .Values.config.database.sslMode | default "disable" }}
{{- $user := ( tpl .Values.config.database.username . ) }}
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -137,7 +138,7 @@ spec:
key: dbPassword
{{- end }}
- name: NEBRASKA_DB_URL
value: {{ printf "postgres://%s:$(DB_PASSWORD)@%s:%s/%s?sslmode=disable&connect_timeout=10" $user $host $port $db | quote }}
value: {{ printf "postgres://%s:$(DB_PASSWORD)@%s:%s/%s?sslmode=%s&connect_timeout=10" $user $host $port $db $sslMode | quote }}
{{- if eq .Values.config.auth.mode "github" }}
- name: "NEBRASKA_GITHUB_OAUTH_CLIENT_ID"
value: "{{ .Values.config.auth.github.clientID }}"
Expand Down
1 change: 1 addition & 0 deletions charts/nebraska/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ config:
dbname: '{{ .Values.postgresql.auth.database }}'
username: '{{ .Values.postgresql.auth.username }}'
password: ""
sslMode: ""
passwordExistingSecret:
enabled: true
name: '{{ .Release.Name }}-postgresql'
Expand Down

0 comments on commit ae64521

Please sign in to comment.