Configuration & Environment Overrides
The cluster definition also supports overriding configuration properties and environment variables, either per role or per role group, where the more specific override (role group) has precedence over the less specific one (role).
Overriding certain properties which are set by the operator (such as the STATS_LOGGER ) can interfere with the operator and can lead to problems.
|
Configuration Properties
For a role or role group, at the same level of config
, you can specify configOverrides
for the superset_config.py
.
For example, if you want to set the CSV export encoding and the preferred databases adapt the nodes
section of the cluster resource as follows:
nodes:
roleGroups:
default:
config: {}
configOverrides:
superset_config.py:
CSV_EXPORT: "{'encoding': 'utf-8'}"
PREFERRED_DATABASES: |-
[
'PostgreSQL',
'Presto',
'MySQL',
'SQLite',
# etc.
]
Just as for the config
, it is possible to specify this at the role level as well:
nodes:
configOverrides:
superset_config.py:
CSV_EXPORT: "{'encoding': 'utf-8'}"
PREFERRED_DATABASES: |-
[
'PostgreSQL',
'Presto',
'MySQL',
'SQLite',
# etc.
]
roleGroups:
default:
config: {}
All override property values must be strings. They are treated as Python expressions. So care must be taken to produce a valid configuration.
For a full list of configuration options we refer to the main config file for Superset.
As Superset can be configured with python code too, arbitrary code can be added to the superset_conf.py
.
You can use either EXPERIMENTAL_FILE_HEADER
to add code to the top or EXPERIMENTAL_FILE_FOOTER
to add to the bottom.
This is an experimental feature |
nodes:
configOverrides:
superset_config.py:
CSV_EXPORT: "{'encoding': 'utf-8'}"
EXPERIMENTAL_FILE_HEADER: |
from modules.my_module import my_class
EXPERIMENTAL_FILE_FOOTER: |
import logging
from superset.security import SupersetSecurityManager
class myCustomSecurityManger(SupersetSecurityManager):
def __init__():
init()
CUSTOM_SECURITY_MANAGER = myCustomSecurityManger
roleGroups:
default:
config: {}
Environment Variables
In a similar fashion, environment variables can be (over)written. For example per role group:
nodes:
roleGroups:
default:
config: {}
envOverrides:
FLASK_ENV: development
or per role:
nodes:
envOverrides:
FLASK_ENV: development
roleGroups:
default:
config: {}
Pod overrides
The Superset operator also supports Pod overrides, allowing you to override any property that you can set on a Kubernetes Pod. Read the Pod overrides documentation to learn more about this feature.