passbolt / charts-passbolt

Helm charts to run Passbolt on Kubernetes. No strings attached charts to run the open source password manager for teams!
https://passbolt.com
GNU Affero General Public License v3.0
40 stars 27 forks source link

not possible to use external database #50

Closed op-euga closed 10 months ago

op-euga commented 10 months ago

It is not possible to use an external e.g. a managed mysql database from google cloud as the passbolt.databaseServiceName is either realeaseName-mariadb-primary or releaseName-mariadb. Even when .Values.passboltEnv.plain.DATASOURCES_DEFAULT_HOST is explicitly set, it will never be taken. So in the deployment the host is always set to one of the above values but never to a custom value. Overwriting in the secrets is also ignored, as the environment variables from the env node in the deployment has higher precedence than the one from envFrom.

maybe you should add a possibility to set external host like this {{- define "passbolt.databaseServiceName" -}} {{- if eq .Values.mariadb.architecture "replication" }} {{- default ( printf "%s-%s-primary" .Release.Name "mariadb" ) .Values.passboltEnv.plain.DATASOURCES_DEFAULT_HOST | quote }} {{- elseif eq .Values.mariadb.architecture "external" }} {{- .Values.passboltEnv.plain.DATASOURCES_DEFAULT_HOST | quote }} {{- else }} {{- default ( printf "%s-%s" .Release.Name "mariadb" ) .Values.passboltEnv.plain.DATASOURCES_DEFAULT_HOST | quote }} {{- end -}} {{- end }}

dlen commented 10 months ago

Hello!

I'm unable to reproduce a quick test with the default values outputs the following:

helm template --debug . -f values.yaml --set passboltEnv.plain.DATASOURCES_DEFAULT_HOST=DB_
HOST |grep -A2 DATASOURCES_DEFAULT_HOST

Returned as expected:

            - name: DATASOURCES_DEFAULT_HOST
              value: "DB_HOST"
          envFrom:

Not sure if I'm missing something

op-euga commented 10 months ago

my fault. was I had put the DATASOURCES_DEFAULT_HOST value to passboltEnv.secret.DATASOURCES_DEFAULT_HOST instead of passboltEnv.plain.DATASOURCES_DEFAULT_HOST It's working now. thanks for your input.