You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "ytihianine (via GitHub)" <gi...@apache.org> on 2025/08/26 19:27:32 UTC
[D] Custom image and helm deployment [superset]
GitHub user ytihianine created a discussion: Custom image and helm deployment
Hey, I am willing to build my own custom image and launch it using a helm deployment.
Currently, my main goal is provide a default config in the image.
My Dockerfile has those line:
```
ARG SUPERSET_VERSION
ARG SUPERSET_REPO
FROM ${SUPERSET_REPO}:${SUPERSET_VERSION}
COPY --from=dsfr_image /app/superset-dsfr/docker/pythonpath_dev/superset_config.py /app/pythonpath/superset_config.py
```
My config has this line (simplified example):
```
# Specify the App icon
APP_ICON = "/static/assets/local/images/app_icon.png"
```
I am also doing other stuffs which work fine !
Building this image and launching it locally with a simple docker run works without any issues.
However, when deploying with Helm using the guide provided in this repo (official superset), my whole app/pythonpath folder is overrided by a template function in the `_helpers.tpl` file : `{{- define "superset-config" }}` which generate the default superset_config without the "import" step at the end.
I've tried to look for a way to disable this behaviour but did not find any :/
If anyone can help :pray:
GitHub link: https://github.com/apache/superset/discussions/34861
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Custom image and helm deployment [superset]
Posted by "ytihianine (via GitHub)" <gi...@apache.org>.
GitHub user ytihianine edited a comment on the discussion: Custom image and helm deployment
@dosu
I updated my Dockerfile to set my custom config on a different folder:
```
COPY --from=dsfr_image /app/superset-dsfr/docker/pythonpath_dev/superset_config_docker.py /app/pythonpath_dsfr/superset_config_docker.py
ENV SUPERSET_CONFIG_PATH=/app/pythonpath_dsfr/superset_config_docker.py
```
it works locally on Docker but using Helm, it uses a SQLite file as database because some lines are not presents in my config:
```
import os
from flask_caching.backends.rediscache import RedisCache
def env(key, default=None):
return os.getenv(key, default)
# Redis Base URL
{{- if .Values.supersetNode.connections.redis_password }}
REDIS_BASE_URL=f"{env('REDIS_PROTO')}://{env('REDIS_USER', '')}:{env('REDIS_PASSWORD')}@{env('REDIS_HOST')}:{env('REDIS_PORT')}"
{{- else }}
REDIS_BASE_URL=f"{env('REDIS_PROTO')}://{env('REDIS_HOST')}:{env('REDIS_PORT')}"
{{- end }}
# Redis URL Params
{{- if .Values.supersetNode.connections.redis_ssl.enabled }}
REDIS_URL_PARAMS = f"?ssl_cert_reqs={env('REDIS_SSL_CERT_REQS')}"
{{- else }}
REDIS_URL_PARAMS = ""
{{- end}}
# Build Redis URLs
CACHE_REDIS_URL = f"{REDIS_BASE_URL}/{env('REDIS_DB', 1)}{REDIS_URL_PARAMS}"
CELERY_REDIS_URL = f"{REDIS_BASE_URL}/{env('REDIS_CELERY_DB', 0)}{REDIS_URL_PARAMS}"
MAPBOX_API_KEY = env('MAPBOX_API_KEY', '')
CACHE_CONFIG = {
'CACHE_TYPE': 'RedisCache',
'CACHE_DEFAULT_TIMEOUT': 300,
'CACHE_KEY_PREFIX': 'superset_',
'CACHE_REDIS_URL': CACHE_REDIS_URL,
}
DATA_CACHE_CONFIG = CACHE_CONFIG
SQLALCHEMY_DATABASE_URI = f"postgresql+psycopg2://{env('DB_USER')}:{env('DB_PASS')}@{env('DB_HOST')}:{env('DB_PORT')}/{env('DB_NAME')}"
SQLALCHEMY_TRACK_MODIFICATIONS = True
```
This behaviour also create issues with logging. Even though my db-init is completed and says that admin user is created, I can't log in with 302 error going.
How can I have a good in-between using my custom config within my image and get some default values needed for my Helm deployment ?
GitHub link: https://github.com/apache/superset/discussions/34861#discussioncomment-14225630
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Custom image and helm deployment [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] added a comment to the discussion: Custom image and helm deployment
<!-- Answer -->
The Superset Helm chart always generates and mounts its own superset_config.py at /app/pythonpath, which overrides any config you bake into your image—even if you set SUPERSET_CONFIG_PATH. This is why your custom config works locally but not with Helm.
There’s no supported way to merge your image config with the Helm-generated defaults. The chart expects to control the main config file and builds things like SQLALCHEMY_DATABASE_URI and Redis settings from Helm values, not from your config file ([source](https://github.com/apache/superset/issues/33945)).
If you want to combine your custom settings (like APP_ICON) with the Helm defaults, the recommended pattern is to use the configOverrides or configOverridesFiles values in your Helm values.yaml. These let you append Python code to the generated config. For example:
```yaml
configOverrides: |
APP_ICON = "/static/assets/local/images/app_icon.png"
```
If you need more complex logic, you can use configOverridesFiles to mount a Python file with your custom code, and then import it at the end of the generated config.
If you want to fully control the config, you can create a Kubernetes Secret with your own superset_config.py and set configFromSecret to its name. But then you must include all required settings (like SQLALCHEMY_DATABASE_URI) yourself, since you’ll be bypassing the Helm defaults ([source](https://github.com/apache/superset/issues/33945)).
There’s no built-in way to have the Helm chart “merge” your image config with its own defaults—the only supported options are to append code via configOverrides or to fully replace the config via a Secret.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback/7f8c0692-3232-433d-b3e4-6252768cb762?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/7f8c0692-3232-433d-b3e4-6252768cb762?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/7f8c0692-3232-433d-b3e4-6252768cb762?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/7f8c0692-3232-433d-b3e4-6252768cb762?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7f8c0692-3232-433d-b3e4-6252768cb762?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/7f8c0692-3232-433d-b3e4-6252768cb762?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7f8c0692-3232-433d-b3e4-6252768cb762?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&
nbsp;[](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/34861)
GitHub link: https://github.com/apache/superset/discussions/34861#discussioncomment-14225650
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Custom image and helm deployment [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] edited a comment on the discussion: Custom image and helm deployment
<!-- Greeting -->
Hi @ytihianine! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team.
<!-- Answer -->
The Helm chart for Superset always mounts a Kubernetes Secret at `/app/pythonpath`, which overrides any `superset_config.py` you include in your custom image. This is done by design using the `superset-config` template in the chart, and there is no built-in flag to disable this behavior or use only the file from your image ([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/helm/superset/templates/_helpers.tpl)).
To use your own config, create a Kubernetes Secret containing your custom `superset_config.py`, then set the `configFromSecret` value in your Helm values file to the name of that Secret. The chart will mount your Secret instead of the default generated config ([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/helm/superset/README.md)). For example:
```bash
kubectl create secret generic my-superset-config \
--from-file=superset_config.py=./superset_config.py
```
Then in your `values.yaml`:
```yaml
configFromSecret: my-superset-config
```
If you only need to append or override a few settings, you can use the `configOverrides` or `configOverridesFiles` values, but these are appended to the generated config and do not replace it entirely.
There is currently no supported way to prevent the Helm chart from mounting a config Secret at `/app/pythonpath` ([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/helm/superset/values.yaml)).
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=0d77c69e-0fa7-4813-bfaf-21cf07851d94) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/34861#discussioncomment-14225371
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Custom image and helm deployment [superset]
Posted by "ytihianine (via GitHub)" <gi...@apache.org>.
GitHub user ytihianine edited a comment on the discussion: Custom image and helm deployment
@dosu
I updated my Dockerfile to set my custom config on a different folder:
```
COPY --from=dsfr_image /app/superset-dsfr/docker/pythonpath_dev/superset_config_docker.py /app/pythonpath_dsfr/superset_config_docker.py
ENV SUPERSET_CONFIG_PATH=/app/pythonpath_dsfr/superset_config_docker.py
```
it works locally on Docker but using Helm, it uses a SQLite file as database because some lines are not presents in my config:
```
import os
from flask_caching.backends.rediscache import RedisCache
def env(key, default=None):
return os.getenv(key, default)
# Redis Base URL
{{- if .Values.supersetNode.connections.redis_password }}
REDIS_BASE_URL=f"{env('REDIS_PROTO')}://{env('REDIS_USER', '')}:{env('REDIS_PASSWORD')}@{env('REDIS_HOST')}:{env('REDIS_PORT')}"
{{- else }}
REDIS_BASE_URL=f"{env('REDIS_PROTO')}://{env('REDIS_HOST')}:{env('REDIS_PORT')}"
{{- end }}
# Redis URL Params
{{- if .Values.supersetNode.connections.redis_ssl.enabled }}
REDIS_URL_PARAMS = f"?ssl_cert_reqs={env('REDIS_SSL_CERT_REQS')}"
{{- else }}
REDIS_URL_PARAMS = ""
{{- end}}
# Build Redis URLs
CACHE_REDIS_URL = f"{REDIS_BASE_URL}/{env('REDIS_DB', 1)}{REDIS_URL_PARAMS}"
CELERY_REDIS_URL = f"{REDIS_BASE_URL}/{env('REDIS_CELERY_DB', 0)}{REDIS_URL_PARAMS}"
MAPBOX_API_KEY = env('MAPBOX_API_KEY', '')
CACHE_CONFIG = {
'CACHE_TYPE': 'RedisCache',
'CACHE_DEFAULT_TIMEOUT': 300,
'CACHE_KEY_PREFIX': 'superset_',
'CACHE_REDIS_URL': CACHE_REDIS_URL,
}
DATA_CACHE_CONFIG = CACHE_CONFIG
SQLALCHEMY_DATABASE_URI = f"postgresql+psycopg2://{env('DB_USER')}:{env('DB_PASS')}@{env('DB_HOST')}:{env('DB_PORT')}/{env('DB_NAME')}"
SQLALCHEMY_TRACK_MODIFICATIONS = True
```
How can I have a good in-between using my custom config within my image and get some default values needed for my Helm deployment ?
GitHub link: https://github.com/apache/superset/discussions/34861#discussioncomment-14225630
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Custom image and helm deployment [superset]
Posted by "ytihianine (via GitHub)" <gi...@apache.org>.
GitHub user ytihianine added a comment to the discussion: Custom image and helm deployment
@dosu
I updated my Dockerfile to set my custom config on a different folder:
```
COPY --from=dsfr_image /app/superset-dsfr/docker/pythonpath_dev/superset_config_docker.py /app/pythonpath_dsfr/superset_config_docker.py
ENV SUPERSET_CONFIG_PATH=/app/pythonpath_dsfr/superset_config_docker.py
```
it works locally on Docker but using Helm, it uses a SQLite file as database because some lines are not presents in my config:
```
mport os
from flask_caching.backends.rediscache import RedisCache
def env(key, default=None):
return os.getenv(key, default)
# Redis Base URL
{{- if .Values.supersetNode.connections.redis_password }}
REDIS_BASE_URL=f"{env('REDIS_PROTO')}://{env('REDIS_USER', '')}:{env('REDIS_PASSWORD')}@{env('REDIS_HOST')}:{env('REDIS_PORT')}"
{{- else }}
REDIS_BASE_URL=f"{env('REDIS_PROTO')}://{env('REDIS_HOST')}:{env('REDIS_PORT')}"
{{- end }}
# Redis URL Params
{{- if .Values.supersetNode.connections.redis_ssl.enabled }}
REDIS_URL_PARAMS = f"?ssl_cert_reqs={env('REDIS_SSL_CERT_REQS')}"
{{- else }}
REDIS_URL_PARAMS = ""
{{- end}}
# Build Redis URLs
CACHE_REDIS_URL = f"{REDIS_BASE_URL}/{env('REDIS_DB', 1)}{REDIS_URL_PARAMS}"
CELERY_REDIS_URL = f"{REDIS_BASE_URL}/{env('REDIS_CELERY_DB', 0)}{REDIS_URL_PARAMS}"
MAPBOX_API_KEY = env('MAPBOX_API_KEY', '')
CACHE_CONFIG = {
'CACHE_TYPE': 'RedisCache',
'CACHE_DEFAULT_TIMEOUT': 300,
'CACHE_KEY_PREFIX': 'superset_',
'CACHE_REDIS_URL': CACHE_REDIS_URL,
}
DATA_CACHE_CONFIG = CACHE_CONFIG
SQLALCHEMY_DATABASE_URI = f"postgresql+psycopg2://{env('DB_USER')}:{env('DB_PASS')}@{env('DB_HOST')}:{env('DB_PORT')}/{env('DB_NAME')}"
SQLALCHEMY_TRACK_MODIFICATIONS = True
```
How can I have a good in-between using my custom config within my image and get some default values needed for my Helm deployment ?
GitHub link: https://github.com/apache/superset/discussions/34861#discussioncomment-14225630
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Custom image and helm deployment [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] added a comment to the discussion: Custom image and helm deployment
<!-- Greeting -->
Hi @ytihianine! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team.
<!-- Answer -->
The Helm chart for Superset always mounts a Kubernetes Secret at `/app/pythonpath`, which overrides any `superset_config.py` you include in your custom image. This is done by design using the `superset-config` template in the chart, and there is no built-in flag to disable this behavior or use only the file from your image ([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/helm/superset/templates/_helpers.tpl)).
To use your own config, create a Kubernetes Secret containing your custom `superset_config.py`, then set the `configFromSecret` value in your Helm values file to the name of that Secret. The chart will mount your Secret instead of the default generated config ([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/helm/superset/README.md)). For example:
```bash
kubectl create secret generic my-superset-config \
--from-file=superset_config.py=./superset_config.py
```
Then in your `values.yaml`:
```yaml
configFromSecret: my-superset-config
```
If you only need to append or override a few settings, you can use the `configOverrides` or `configOverridesFiles` values, but these are appended to the generated config and do not replace it entirely.
There is currently no supported way to prevent the Helm chart from mounting a config Secret at `/app/pythonpath` ([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/helm/superset/values.yaml)).
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback/0d77c69e-0fa7-4813-bfaf-21cf07851d94?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/0d77c69e-0fa7-4813-bfaf-21cf07851d94?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/0d77c69e-0fa7-4813-bfaf-21cf07851d94?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/0d77c69e-0fa7-4813-bfaf-21cf07851d94?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0d77c69e-0fa7-4813-bfaf-21cf07851d94?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/0d77c69e-0fa7-4813-bfaf-21cf07851d94?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/0d77c69e-0fa7-4813-bfaf-21cf07851d94?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&
nbsp;[](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/34861)
GitHub link: https://github.com/apache/superset/discussions/34861#discussioncomment-14225371
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Custom image and helm deployment [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] edited a comment on the discussion: Custom image and helm deployment
<!-- Answer -->
The Superset Helm chart always generates and mounts its own superset_config.py at /app/pythonpath, which overrides any config you bake into your image—even if you set SUPERSET_CONFIG_PATH. This is why your custom config works locally but not with Helm.
There’s no supported way to merge your image config with the Helm-generated defaults. The chart expects to control the main config file and builds things like SQLALCHEMY_DATABASE_URI and Redis settings from Helm values, not from your config file ([source](https://github.com/apache/superset/issues/33945)).
If you want to combine your custom settings (like APP_ICON) with the Helm defaults, the recommended pattern is to use the configOverrides or configOverridesFiles values in your Helm values.yaml. These let you append Python code to the generated config. For example:
```yaml
configOverrides: |
APP_ICON = "/static/assets/local/images/app_icon.png"
```
If you need more complex logic, you can use configOverridesFiles to mount a Python file with your custom code, and then import it at the end of the generated config.
If you want to fully control the config, you can create a Kubernetes Secret with your own superset_config.py and set configFromSecret to its name. But then you must include all required settings (like SQLALCHEMY_DATABASE_URI) yourself, since you’ll be bypassing the Helm defaults ([source](https://github.com/apache/superset/issues/33945)).
There’s no built-in way to have the Helm chart “merge” your image config with its own defaults—the only supported options are to append code via configOverrides or to fully replace the config via a Secret.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=7f8c0692-3232-433d-b3e4-6252768cb762) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/34861#discussioncomment-14225650
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org