Add a new socle PostgresSQL addon
Problem
I started to integrate keycloak-x
as a replacement for the actual keycloak and found that the keycloak-x codecentric chart does not include a PostgreSQL subchart.
We need to provide a socle addon to install a PostgreSQL to be used, preferably by all addons.
Proposal
- new socle addon
postgresql
using bitnami chart - centralised
postgresql
configuration for either external or addon provided database - tools to create per addon user and database
Use external PostgreSQL
Do not ask for PostgreSQL installation and provide address/port configuration:
[postgresql]
install=false
address=postgres.example.net
port=5432
adminUser=changeme
adminPassword=changeme
Use internal addon
[postgresql]
install=true
namespace=laboite-postgresql
# address=automatically calculated
# port=automatically calculated
adminUser=changeme
adminPassword=changeme
Open questions
- Is it meaningful to default the namespace to
{{ [general][namespace] }}-postgresql
? - Provide an easier way for addons to override parameters, for example, the following example is quite difficult to read:
database: vendor: postgres {%- if config['postgresql']['install'] %} hostname: {{ 'postgres' ~ config['postgresql']['namespace'] | tojson }} port: {{ config['postgres']['port'] | default('5432', true) | tojson }} {%- else %} hostname: {{ config['keycloak']['postgresAddress'] | default(config['postgresql']['address'], true) | tojson }} port: {{ config['keycloak']['postgresPort'] | default(config['postgresql'][port], true) | tojson }} {%- endif %}