GitHub user Kranthi32 added a comment to the discussion: Production deployment 
issue in

@dosu 

My PostgreSQL password contains special characters like @ and $, 
e.g.:**JjJ0Fkk@rEP$UlHr**

I inject it securely via Kubernetes secret:   kubectl create secret generic 
superset-db-creds --from-literal=DB_PASS='JjJ0Fkk@rEP$UlHr' --namespace superset

Then I reference it in values.yaml:

Even with this setup, Superset init fails with: could not translate host name 
"[email protected]" to address: Name or service not known 
Also tried encoding (%40, %24) — but Superset still breaks with hostname 
parsing error.


logs: 

kubectl logs superset-init-db-mhlzc -n superset
Defaulted container "superset-init-db" out of: superset-init-db, 
wait-for-postgres (init)
Upgrading DB schema...
logging was configured successfully
2025-06-28 07:56:40,104:INFO:superset.utils.logging_configurator:logging was 
configured successfully
2025-06-28 07:56:40,108:INFO:root:Configured event logger of type <class 
'superset.utils.log.DBEventLogger'>
2025-06-28 07:56:40,113:ERROR:flask_appbuilder.security.sqla.manager:DB 
Creation and initialization failed: (psycopg2.OperationalError) could not 
translate host name "[email protected]" 
to address: Name or service not known

(Background on this error at: https://sqlalche.me/e/14/e3q8)
Loaded your LOCAL configuration at [/app/pythonpath/superset_config.py]

my-values.yaml

# Use your custom Superset image (built with redis & psycopg2-binary)
image:
  repository: reddy2210/superset-custom
  tag: 2.1.0
  pullPolicy: Always


# Enable internal Redis (optional: use external by changing redis.enabled: 
false)
redis:
  enabled: true
  auth:
    enabled: false

# Disable internal PostgreSQL
postgresql:
  enabled: false

# Secret key for Flask sessions
extraSecretEnv:
  SUPERSET_SECRET_KEY: 
'OG6tANx8xP8QAo9sabJAwUAjUs2OO7hEPmTqjgxqnj5TnjLouQP1tULQ'

# Inject password from secret
envFromSecrets:
  - superset-db-creds

# Configure Superset to use external Azure PostgreSQL
supersetNode:
  connections:
    db_host: appsqlsscind01.private.postgres.database.azure.com
    db_port: "5432"
    db_user: sspsqladmin
    #db_pass: "SsS0Ftw%%40rEP%%24qlSs"  # Make sure to avoid special characters 
or quote properly
    db_name: superset
    extraArgs: "?sslmode=require"
    redis_host: superset-redis-master
    redis_port: "6379"
    redis_cache_db: "1"
    redis_celery_db: "0"
  extraEnv:
    - name: DB_HOST
      value: appsqlsscind01.private.postgres.database.azure.com
    - name: DB_PORT
      value: "5432"
    - name: DB_USER
      value: sspsqladmin
    - name: DB_NAME
      value: superset
   

# Add Redis cache config to superset_config.py
configOverrides:
  superset_config.py: |
    import os
    from flask_caching import Cache

    ENABLE_PROXY_FIX = True

    DB_USER = os.getenv("DB_USER")
    DB_PASS = os.getenv("DB_PASS")
    DB_HOST = os.getenv("DB_HOST")
    DB_PORT = os.getenv("DB_PORT")
    DB_NAME = os.getenv("DB_NAME")

    SQLALCHEMY_DATABASE_URI = (
        
f"postgresql+psycopg2://{DB_USER}:{DB_PASS}@{DB_HOST}:{DB_PORT}/{DB_NAME}?sslmode=require"
    )

    RESULTS_BACKEND = Cache(
        config={
            'CACHE_TYPE': 'RedisCache',
            'CACHE_DEFAULT_TIMEOUT': 300,
            'CACHE_KEY_PREFIX': 'superset_results',
            'CACHE_REDIS_URL': 'redis://superset-redis-master:6379/0'
        }
    )

    FILTER_STATE_CACHE_CONFIG = {
        "CACHE_TYPE": "RedisCache",
        "CACHE_DEFAULT_TIMEOUT": 300,
        "CACHE_KEY_PREFIX": "superset_filter_state",
        "CACHE_REDIS_URL": "redis://superset-redis-master:6379/0"
    }

    EXPLORE_FORM_DATA_CACHE_CONFIG = {
        "CACHE_TYPE": "RedisCache",
        "CACHE_DEFAULT_TIMEOUT": 300,
        "CACHE_KEY_PREFIX": "superset_explore_form",
        "CACHE_REDIS_URL": "redis://superset-redis-master:6379/0"
    }

    TALISMAN_ENABLED = True
    TALISMAN_CONFIG = {
        "content_security_policy": {
            "default-src": ["'self'"],
            "img-src": ["'self'", "data:", "blob:"],
        }
    }

# Create admin user
init:
  createAdmin: true
  adminUser:
    username: admin
    firstname: Superset
    lastname: Admin
    email: [email protected]
    password: C@reS0ft
  loadExamples: false

# Optional: Resource limits
resources:
  limits:
    cpu: 1000m
    memory: 2Gi
  requests:
    cpu: 500m
    memory: 1Gi




GitHub link: 
https://github.com/apache/superset/discussions/33957#discussioncomment-13603878

----
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