Skip to content
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

add the option to define the sslMode for the database connection #672

Merged
merged 1 commit into from
Mar 7, 2024
Merged
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
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