Skip to content

Commit

Permalink
Merge pull request #7 from dannysauer/feat/dannys/support_db_operator
Browse files Browse the repository at this point in the history
Update to support DB Operator
  • Loading branch information
motatoes authored May 1, 2024
2 parents ecaf49a + 704cb23 commit 6013b4c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/digger-backend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.2
version: 0.1.3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
4 changes: 4 additions & 0 deletions charts/digger-backend/templates/backend-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,21 @@ spec:
- secretRef:
{{- if not .Values.digger.secret.useExistingSecret }}
name: {{ include "digger-backend.fullname" . }}-secret
{{- else if .Values.digger.postgres.existingSecretName }}
name: {{ .Values.digger.postgres.existingSecretName }}
{{- else }}
name: {{ .Values.digger.secret.existingSecretName }}
{{- end }}
env:
- name: HTTP_BASIC_AUTH
value: "1"
{{- if not .Values.digger.postgres.existingSecretName }}
- name: DATABASE_URL
{{- if .Values.postgres.enabled }}
value: "postgres://postgres:$(POSTGRES_PASSWORD)@{{ include "digger-backend.fullname" . }}-postgres:5432/postgres?sslmode=disable"
{{- else }}
value: "postgres://{{ .Values.digger.postgres.user }}:$(POSTGRES_PASSWORD)@{{ .Values.digger.postgres.host }}:{{ .Values.digger.postgres.port }}/{{ .Values.digger.postgres.database }}"
{{- end }}
{{- end }}
- name: ALLOW_DIRTY
value: "{{ .Values.digger.postgres.allow_dirty }}"
6 changes: 6 additions & 0 deletions charts/digger-backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ digger:
# configure this section if you want to use an external postgres database

postgres:
# if the DB connection string is already in a secret
# DB connection string should be in a key names DATABASE_URL
# compatible with https://github.com/kloeckner-i/db-operator, for example
existingSecretName: ""

# to define connection details in chart:
user: ""
database: ""
host: ""
Expand Down

0 comments on commit 6013b4c

Please sign in to comment.