GitHub user pettermk edited a comment on the discussion: Bring my own secret 
for postgresql connection

Since `configOverrides` allows you to override any existing superset 
configuration in `superset_config.py`, I found the most flexible way to be 
making a secret containing the full Postgres URI for the metadatabase, and 
exposing that as an environment variable using `extraEnvRaw`:

```yaml
    extraEnvRaw:
    - name: SQLALCHEMY_DATABASE_URI
      valueFrom:
        secretKeyRef:
          name: superset-db-app
          key: uri
```
Then reading that secret into SQLALCHEMY_DATABASE_URI in `superset_config.py`, 
which overrides the default way it's built using the host, password etc.
 ```yaml   
    configOverrides:
      database: |
        SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATABASE_URI')
```
and that's all you need, really, to use a metadatabase of your own choice.

GitHub link: 
https://github.com/apache/superset/discussions/27916#discussioncomment-12268426

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to