Skip to content

Commit

Permalink
Custom superset_config.py + secret envs (apache#13096)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yann-J authored and amitmiran137 committed Feb 14, 2021
1 parent ad1c56f commit cd2feaf
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
9 changes: 9 additions & 0 deletions helm/superset/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,13 @@ RESULTS_BACKEND = RedisCache(
port=env('REDIS_PORT'),
key_prefix='superset_results'
)

{{ if .Values.configOverrides }}
# Overrides
{{- range $key, $value := .Values.configOverrides }}
# {{ $key }}
{{ $value }}
{{- end }}
{{- end }}

{{- end }}
5 changes: 5 additions & 0 deletions helm/superset/templates/secret-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ data:
DB_USER: {{ .Values.supersetNode.connections.db_user | b64enc | quote }}
DB_PASS: {{ .Values.supersetNode.connections.db_pass | b64enc | quote }}
DB_NAME: {{ .Values.supersetNode.connections.db_name | b64enc | quote }}
{{- if .Values.extraSecretEnv }}
{{- range $key, $value := .Values.extraSecretEnv }}
{{ $key }}: {{ $value | b64enc | quote }}
{{- end }}
{{- end }}
31 changes: 31 additions & 0 deletions helm/superset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ envFromSecret: '{{ template "superset.fullname" . }}-env'
##
extraEnv: {}

## Extra environment variables to pass as secrets
##
extraSecretEnv: {}
# MAPBOX_API_KEY: ...
# GOOGLE_KEY: ...
# GOOGLE_SECRET: ...

extraConfigs: {}
# datasources-init.yaml: |
# databases:
Expand All @@ -54,6 +61,30 @@ extraConfigs: {}
# sqlalchemy_uri: example://example-db.local
# tables: []

# A dictionary of overrides to append at the end of superset_config.py - the name does not matter
# WARNING: the order is not guaranteed
configOverrides: {}
# enable_oauth: |
# from flask_appbuilder.security.manager import AUTH_DB
# AUTH_TYPE = AUTH_OAUTH

# OAUTH_PROVIDERS = [
# {
# "name": "google",
# "icon": "fa-google",
# "token_key": "access_token",
# "remote_app": {
# "client_id": os.environ.get("GOOGLE_KEY"),
# "client_secret": os.environ.get("GOOGLE_SECRET"),
# "api_base_url": "https://www.googleapis.com/oauth2/v2/",
# "client_kwargs": {"scope": "email profile"},
# "request_token_url": None,
# "access_token_url": "https://accounts.google.com/o/oauth2/token",
# "authorize_url": "https://accounts.google.com/o/oauth2/auth",
# },
# }
# ]

configMountPath: "/app/pythonpath"

extraConfigMountPath: "/app/configs"
Expand Down

0 comments on commit cd2feaf

Please sign in to comment.