zalf-rdm / geonode-k8s

A Kubernetes helm chart for the geospacial webapplication Geonode
https://geonode-k8s.readthedocs.io/en/latest/
GNU General Public License v2.0
13 stars 8 forks source link

Feature: Customize db user password keys #213

Open TheNumenorean opened 1 week ago

TheNumenorean commented 1 week ago

Feature Description

Can this value be made configurable? https://github.com/zalf-rdm/geonode-k8s/blob/1c951cb4d26a396077fe76ba0fb42fc3525778da/charts/geonode/templates/_helpers.tpl#L97

I want to use existing secrets to populate the db passwords, but the keys are not "geonode-*".

Proposed Solution

Add a configuration to specify geonode.secret.existingSecretName for the postgres, geodata, and geonode users separately, rather than using one for all of them. Then, add a config to specify the key in the secret to receive the password from.

Additional Information

I am using the zalando pgo manually since i want more customization, and need to use the secrets it generates.

mwallschlaeger commented 1 week ago

@TheNumenorean i understand your request. Within our setup we're not deploying the postgres-operator using geonode-k8s but still build the database with geonode-k8s. You can do so by setting:

postgres-operator:
  enabled: False
postgres:
  type: operator
  operator:
    storageSize: 2Gi
    numberOfInstances: 1
    postgres_version: 15

find more information on different database setups in geonode-k8s here: https://github.com/zalf-rdm/geonode-k8s/pull/150

Nevertheless we can make the secret name a variable in near future. Would you have time to contribute this as a PR?

TheNumenorean commented 1 week ago

That makes sense; specifically what i needed was to add an additional user and database, since i am taking advantage of colocating the data with another app for query purposes. I believe that isn't possible currently when geonode-k8s is creating the database entity, but honestly i think that's fine, given that creating it myself is pretty easy (barring the secret issue).

There is a good chance I can put in a PR, though not for a week at least.