Skip to content

Commit

Permalink
Merge pull request #147 from eclipse-tractusx/feat/helm/gate-postgres
Browse files Browse the repository at this point in the history
Chart BPDM Gate: Add postgres chart dependency
  • Loading branch information
nicoprow authored May 12, 2023
2 parents c28f3b7 + e6954b7 commit cef7bd9
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 4 deletions.
4 changes: 4 additions & 0 deletions charts/gate/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ The format is based on Keep a Changelog (https://keepachangelog.com/en/1.0.0/),
- increase to app version 4.0.0
- add missing license headers to ingress templates

### Added

- postgres chart dependency for persistence

## [3.3.0] - 2023-03-17

### Changed
Expand Down
8 changes: 7 additions & 1 deletion charts/gate/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ apiVersion: v2
type: application
name: bpdm-gate
appVersion: "4.0.0-alpha.1"
version: 4.0.0-alpha.3
version: 4.0.0-alpha.4
description: A Helm chart for deploying the BPDM gate service
home: https://eclipse-tractusx.github.io/docs/kits/Business%20Partner%20Kit/Adoption%20View
sources:
- https://github.com/eclipse-tractusx/bpdm
dependencies:
- name: postgresql
version: 11.9.1
repository: https://charts.bitnami.com/bitnami
alias: postgres
condition: postgres.enabled
maintainers:
- name: Nico Koprowski
17 changes: 17 additions & 0 deletions charts/gate/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,20 @@ Create name of application secret
{{- define "bpdm.applicationSecret.name" -}}
{{- printf "%s-application" (include "bpdm.fullname" .) }}
{{- end }}

{/*
Determine postgres service/host name to connect to
*/}}
{{- define "bpdm.postgresDependency" -}}
{{- include "includeWithPostgresContext" (list $ "postgresql.primary.fullname") }}
{{- end }}}

{{/*
Invoke include on given definition with postgresql dependency context
Usage: include "includeWithPostgresContext" (list $ "your_include_function_here")
*/}}
{{- define "includeWithPostgresContext" -}}
{{- $ := index . 0 }}
{{- $function := index . 1 }}
{{- include $function (dict "Values" $.Values.postgres "Chart" (dict "Name" "postgres") "Release" $.Release) }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/gate/templates/configMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ data:
# Place for putting standard deployment configuration
# which can be overwritten by external.yml
bpdm:
datasource:
host: {{ include "bpdm.postgresDependency" . }}
pool:
base-url: http://pool-bpdm:8080/api/catena
external.yml: |-
Expand Down
17 changes: 14 additions & 3 deletions charts/gate/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,17 @@ applicationConfig:

# Used to overwrite the secret property values of the application configuration
applicationSecrets:
# bpdm:
# saas:
# api-key: ...
spring:
datasource:
# overwrite for security reasons
password: bpdm

postgres:
enabled: true
auth:
database: bpdm
# overwrite for security reasons
postgresPassword: bpdm
username: bpdm
# overwrite for security reasons
password: bpdm

0 comments on commit cef7bd9

Please sign in to comment.