apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: superset
  namespace: superset
spec:
  interval: 5m
  timeout: 20m
  values:
    fullnameOverride: superset
    vault:
      enabled: false
    stronghold:
      enabled: false
    extraEnv:
      GUNICORN_TIMEOUT: "300"
      SERVER_WORKER_AMOUNT: "4"
      BABEL_DEFAULT_LOCALE: ru
    extraEnvRaw:
      - name: ENABLE_PROXY_FIX
        value: "true"
      - name: JWT_SECRET
        valueFrom:
          secretKeyRef:
            name: jwt-secret
            key: jwt_secret
    supersetNode:
      connections:
        redis_host: superset-redis-headless
        redis_port: "6379"
        redis_user: ""
        redis_cache_db: "1"
        redis_celery_db: "0"
        db_host: sarex-vpsql-01.xc.wb.ru
        db_port: "5432"
        db_user: superset
        db_name: ss
      resources:
        requests:
          cpu: 500m
          memory: 1Gi
        limits:
          memory: 2Gi
    supersetWorker:
      resources:
        requests:
          cpu: 500m
          memory: 1Gi
        limits:
          memory: 2Gi
    init:
      loadExamples: false
    postgresql:
      enabled: false
    redis:
      enabled: true
      image:
        registry: docker.io
        repository: bitnamilegacy/redis
        tag: 7.0.10-debian-11-r4
      architecture: standalone
      auth:
        enabled: false
        existingSecret: ""
        existingSecretKey: ""
        password: ""
      master:
        persistence:
          enabled: false
    configOverrides:
      feature_flags: |
        FEATURE_FLAGS = {
            "EMBEDDED_SUPERSET": True,
            "ENABLE_TEMPLATE_PROCESSING": True,
        }
      iframe_config: |
        X_FRAME_OPTIONS = None
        HTTP_HEADERS = {
            "Content-Security-Policy": "frame-ancestors https://*.wb.ru",
        }
      extend_timeout: |
        SQLLAB_ASYNC_TIME_LIMIT_SEC = 300
        SUPERSET_WEBSERVER_TIMEOUT = 300
        SQLLAB_TIMEOUT = 600
      set_locale: |
        BABEL_DEFAULT_LOCALE = "ru"
      enable_oauth: ""
    extraConfigs:
      import_datasources.yaml: |
        databases:
          - database_name: trino
            sqlalchemy_uri: trino://superset@trino.trino.svc.cluster.local:8080
            expose_in_sqllab: true
            allow_ctas: true
            allow_cvas: true
            allow_dml: false
