Bring my own secret for postgresql connection #27916
Replies: 3 comments 2 replies
-
it works fine with adding ingore diffs to argocd application: ignoreDifferences:
- kind: Secret
name: superset-env
namespace: superset
jsonPointers:
- /data/DB_HOST
- /data/DB_NAME
- /data/DB_PASS
- /data/DB_USER however I would still prefer a way to specify my own secret for postgresql connection paramaters. |
Beta Was this translation helpful? Give feedback.
-
The following configuration works for us:
You can then create your own secret, but this must have the name superset-env. The secret must contain all the values that are otherwise defined in https://github.com/apache/superset/blob/master/helm/superset/templates/secret-env.yaml. |
Beta Was this translation helpful? Give feedback.
-
Here's how I addressed this:
---
kind: Secret
apiVersion: v1
metadata:
name: superset-secrets-helm-override
namespace: superset
type: Opaque
data:
DB_HOST: <base64 value>
DB_NAME: <base64 value>
DB_PASS: d<base64 value>
DB_PORT: <base64 value>
DB_USER: <base64 value>
REDIS_CELERY_DB: <base64 value>
REDIS_DB: <base64 value>
REDIS_HOST: <base64 value>
REDIS_PORT: <base64 value>
REDIS_PROTO: <base64 value>
REDIS_USER: ""
## Custom
SUPERSET_SECRET_KEY: <base64 value>
## LDAP
AUTH_LDAP_SERVER: <base64 value>
AUTH_LDAP_SEARCH: <base64 value>
AUTH_LDAP_UID_FIELD: <base64 value>
AUTH_LDAP_BIND_USER: <base64 value>
AUTH_LDAP_BIND_PASSWORD: <base64 value>
AUTH_LDAP_BIND_DOMAIN: <base64 value>
## EMAIL STUFF
SMTP_VALUE_A: <base64 value>
SMTP_VALUE_B: <base64 value>
SMTP_VALUE_C: <base64 value>
SMTP_VALUE_D: <base64 value>
## OTHER SENSITIVE DATA
SENSITIVE_VALUE_A: <base64 value>
SENSITIVE_VALUE_B: <base64 value>
SENSITIVE_VALUE_C: <base64 value>
SENSITIVE_VALUE_D: <base64 value>
secretEnv:
create: false
envFromSecret: 'superset-secrets-helm-override' ## This will make the secret values created on the fist step to be available in the pod container as environmental variables.
PERMANENT_SESSION_LIFETIME = int(os.environ.get('PERMANENT_SESSION_LIFETIME')) Example for configOverrides: ## This translates to the superset_config.py file https://github.com/apache/superset/blob/master/superset/config.py
secret: |
## The use of `.encode('utf-8').strip()` is only needed for the `SUPERSET_SECRET_KEY` value
SECRET_KEY = os.environ.get("SUPERSET_SECRET_KEY").encode('utf-8').strip()
enable_ldap: |
from flask_appbuilder.security.manager import AUTH_LDAP
# search configs
AUTH_LDAP_SEARCH = str(os.environ.get('AUTH_LDAP_SEARCH'))
AUTH_LDAP_UID_FIELD = str(os.environ.get('AUTH_LDAP_UID_FIELD'))
AUTH_LDAP_BIND_USER = str(os.environ.get('AUTH_LDAP_BIND_USER'))
AUTH_LDAP_BIND_PASSWORD = str(os.environ.get('AUTH_LDAP_BIND_PASSWORD'))
AUTH_LDAP_BIND_DOMAIN = str(os.environ.get('AUTH_LDAP_BIND_DOMAIN')) Tip For some reason while trying to get the configOverrides: ## This translates to the superset_config.py file https://github.com/apache/superset/blob/master/superset/config.py
secret: |
## The use of `.encode('utf-8').strip()` is only needed for the `SUPERSET_SECRET_KEY` value
SECRET_KEY = os.environ.get("SUPERSET_SECRET_KEY").encode('utf-8').strip() |
Beta Was this translation helpful? Give feedback.
-
Hi,
I want to configure external postgresql to work with superset, however doing it in helm values does not work well with GitOps since I don't want to have my username/pass in git. I can provision my own secret, but I don't see a way to tell helm chart to use it for env vars for this purpose.
I have also tried to merge the existing secret with new values (using external-secrets) which would work in theory, but argocd syncs it back to original values.
Any suggestions to do it properly with argocd+external-secrets if there is no native way to configure it via helm?
Beta Was this translation helpful? Give feedback.
All reactions