diff --git a/helm/superset/Chart.yaml b/helm/superset/Chart.yaml index 189ffcdb38a2d..0672a2955cc10 100644 --- a/helm/superset/Chart.yaml +++ b/helm/superset/Chart.yaml @@ -23,12 +23,3 @@ maintainers: email: craig@craigrueda.com url: https://github.com/craig-rueda version: 0.5.9 -dependencies: -- name: postgresql - version: 10.2.0 - repository: https://charts.bitnami.com/bitnami - condition: postgresql.enabled -- name: redis - version: 16.3.1 - repository: https://charts.bitnami.com/bitnami - condition: redis.enabled diff --git a/helm/superset/templates/_helpers.tpl b/helm/superset/templates/_helpers.tpl index 593fd0319885d..847dac6575cc8 100644 --- a/helm/superset/templates/_helpers.tpl +++ b/helm/superset/templates/_helpers.tpl @@ -79,6 +79,8 @@ CACHE_CONFIG = { } DATA_CACHE_CONFIG = CACHE_CONFIG +ENABLE_PROXY_FIX = True +PROXY_FIX_CONFIG = {"x_for": 1, "x_proto": 1, "x_host": 1, "x_port": 0, "x_prefix": 1} 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 SECRET_KEY = env('SECRET_KEY', 'thisISaSECRET_1234') @@ -93,11 +95,11 @@ class CeleryConfig(object): CELERY_IMPORTS = ('superset.sql_lab', ) CELERY_ANNOTATIONS = {'tasks.add': {'rate_limit': '10/s'}} {{- if .Values.supersetNode.connections.redis_password }} - BROKER_URL = f"redis://:{env('REDIS_PASSWORD')}@{env('REDIS_HOST')}:{env('REDIS_PORT')}/0" - CELERY_RESULT_BACKEND = f"redis://:{env('REDIS_PASSWORD')}@{env('REDIS_HOST')}:{env('REDIS_PORT')}/0" + BROKER_URL = f"redis://:{env('REDIS_PASSWORD')}@{env('REDIS_HOST')}:{env('REDIS_PORT')}/{env('REDIS_DB')}" + CELERY_RESULT_BACKEND = f"redis://:{env('REDIS_PASSWORD')}@{env('REDIS_HOST')}:{env('REDIS_PORT')}/{env('REDIS_DB')}" {{- else }} - BROKER_URL = f"redis://{env('REDIS_HOST')}:{env('REDIS_PORT')}/0" - CELERY_RESULT_BACKEND = f"redis://{env('REDIS_HOST')}:{env('REDIS_PORT')}/0" + BROKER_URL = f"redis://{env('REDIS_HOST')}:{env('REDIS_PORT')}/{env('REDIS_DB')}" + CELERY_RESULT_BACKEND = f"redis://{env('REDIS_HOST')}:{env('REDIS_PORT')}/{env('REDIS_DB')}" {{- end }} CELERY_CONFIG = CeleryConfig @@ -107,6 +109,7 @@ RESULTS_BACKEND = RedisCache( password=env('REDIS_PASSWORD'), {{- end }} port=env('REDIS_PORT'), + db=env('REDIS_DB'), key_prefix='superset_results' ) diff --git a/helm/superset/templates/deployment.yaml b/helm/superset/templates/deployment.yaml index 10de683b3b184..666da37d34e39 100644 --- a/helm/superset/templates/deployment.yaml +++ b/helm/superset/templates/deployment.yaml @@ -70,6 +70,16 @@ spec: hostAliases: {{ toYaml . | nindent 6 }} {{- end }} containers: + - name: nginx + image: nginx + imagePullPolicy: IfNotPresent + ports: + - name: nginx + containerPort: 80 + volumeMounts: + - name: superset-extra-config + mountPath: /etc/nginx/conf.d/default.conf + subPath: nginx.conf - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} diff --git a/helm/superset/templates/secret-env.yaml b/helm/superset/templates/secret-env.yaml index 4126507324439..7b5c68ef79075 100644 --- a/helm/superset/templates/secret-env.yaml +++ b/helm/superset/templates/secret-env.yaml @@ -30,6 +30,7 @@ stringData: REDIS_PASSWORD: {{ .Values.supersetNode.connections.redis_password | quote }} {{- end }} REDIS_PORT: {{ .Values.supersetNode.connections.redis_port | quote }} + REDIS_DB: {{ .Values.supersetNode.connections.redis_db | quote }} DB_HOST: {{ tpl .Values.supersetNode.connections.db_host . | quote }} DB_PORT: {{ .Values.supersetNode.connections.db_port | quote }} DB_USER: {{ .Values.supersetNode.connections.db_user | quote }} diff --git a/helm/superset/templates/service.yaml b/helm/superset/templates/service.yaml index 0124ad2a9d04a..33ec437f377ae 100644 --- a/helm/superset/templates/service.yaml +++ b/helm/superset/templates/service.yaml @@ -30,10 +30,10 @@ metadata: spec: type: {{ .Values.service.type }} ports: - - port: {{ .Values.service.port }} - targetPort: http + - port: {{ .Values.service.servicePort }} + targetPort: 80 protocol: TCP - name: http + name: https selector: app: {{ template "superset.name" . }} release: {{ .Release.Name }} diff --git a/helm/superset/values.schema.json b/helm/superset/values.schema.json index 2abe2b4b7b072..d8ba8939ba40c 100644 --- a/helm/superset/values.schema.json +++ b/helm/superset/values.schema.json @@ -141,6 +141,9 @@ "port": { "type": "integer" }, + "servicePort": { + "type": "integer" + }, "annotations": { "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta/properties/annotations" }, @@ -150,7 +153,8 @@ }, "required": [ "type", - "port" + "port", + "servicePort" ] }, "ingress": { @@ -232,6 +236,9 @@ "redis_port": { "type": "string" }, + "redis_db": { + "type": "string" + }, "db_host": { "type": "string" }, @@ -251,6 +258,7 @@ "required": [ "redis_host", "redis_port", + "redis_db", "db_host", "db_port", "db_user", diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml index 392af0cbe276a..c2ad4ff92ed1f 100644 --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -173,6 +173,7 @@ initImage: service: type: ClusterIP port: 8088 + servicePort: 8088 annotations: {} # cloud.google.com/load-balancer-type: "Internal" loadBalancerIP: null @@ -228,6 +229,7 @@ supersetNode: redis_host: '{{ template "superset.fullname" . }}-redis-headless' # redis_password: superset redis_port: "6379" + redis_db: "0" # You need to change below configuration incase bringing own PostgresSQL instance and also set postgresql.enabled:false db_host: '{{ template "superset.fullname" . }}-postgresql' db_port: "5432"