From 9ac69d43a4a9fc309de5c3e33e90d717cc4f35bc Mon Sep 17 00:00:00 2001 From: sangarshanan Date: Mon, 21 Feb 2022 11:23:55 +0530 Subject: [PATCH 1/7] Add redis DB to values --- helm/superset/templates/_helpers.tpl | 9 +++++---- helm/superset/templates/secret-env.yaml | 1 + helm/superset/values.schema.json | 4 ++++ helm/superset/values.yaml | 1 + 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/helm/superset/templates/_helpers.tpl b/helm/superset/templates/_helpers.tpl index 593fd0319885d..fb58de86d0b33 100644 --- a/helm/superset/templates/_helpers.tpl +++ b/helm/superset/templates/_helpers.tpl @@ -93,11 +93,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 +107,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/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/values.schema.json b/helm/superset/values.schema.json index 2abe2b4b7b072..efa395a0200f1 100644 --- a/helm/superset/values.schema.json +++ b/helm/superset/values.schema.json @@ -232,6 +232,9 @@ "redis_port": { "type": "string" }, + "redis_db": { + "type": "string" + }, "db_host": { "type": "string" }, @@ -251,6 +254,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..ea48de67c182e 100644 --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -228,6 +228,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" From 9b2868b6ae6561b9933f255fec49a8a0efa2643c Mon Sep 17 00:00:00 2001 From: sangarshanan Date: Mon, 21 Feb 2022 17:25:55 +0530 Subject: [PATCH 2/7] Add target port --- helm/superset/templates/service.yaml | 4 ++-- helm/superset/values.schema.json | 6 +++++- helm/superset/values.yaml | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/helm/superset/templates/service.yaml b/helm/superset/templates/service.yaml index 0124ad2a9d04a..202ce6382c7b6 100644 --- a/helm/superset/templates/service.yaml +++ b/helm/superset/templates/service.yaml @@ -31,9 +31,9 @@ spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} - targetPort: http + targetPort: {{ .Values.service.targetPort }} 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 efa395a0200f1..0c052741cba60 100644 --- a/helm/superset/values.schema.json +++ b/helm/superset/values.schema.json @@ -431,10 +431,14 @@ "properties": { "port": { "type": "integer" + }, + "targetPort": { + "type": "integer" } }, "required": [ - "port" + "port", + "targetPort" ] }, "postgresqlUsername": { diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml index ea48de67c182e..84c97400d4b88 100644 --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -173,6 +173,7 @@ initImage: service: type: ClusterIP port: 8088 + targetPort: 8088 annotations: {} # cloud.google.com/load-balancer-type: "Internal" loadBalancerIP: null From 6f17329a95eec1fabe3cf1ab7f97b8d3bdc004e0 Mon Sep 17 00:00:00 2001 From: sangarshanan Date: Mon, 21 Feb 2022 17:38:26 +0530 Subject: [PATCH 3/7] Add servicePort --- helm/superset/templates/service.yaml | 4 ++-- helm/superset/values.schema.json | 9 +++++---- helm/superset/values.yaml | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/helm/superset/templates/service.yaml b/helm/superset/templates/service.yaml index 202ce6382c7b6..9fbbb8745b5a6 100644 --- a/helm/superset/templates/service.yaml +++ b/helm/superset/templates/service.yaml @@ -30,8 +30,8 @@ metadata: spec: type: {{ .Values.service.type }} ports: - - port: {{ .Values.service.port }} - targetPort: {{ .Values.service.targetPort }} + - port: {{ .Values.service.servicePort }} + targetPort: http protocol: TCP name: https selector: diff --git a/helm/superset/values.schema.json b/helm/superset/values.schema.json index 0c052741cba60..315d1300834cc 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": { @@ -431,9 +435,6 @@ "properties": { "port": { "type": "integer" - }, - "targetPort": { - "type": "integer" } }, "required": [ diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml index 84c97400d4b88..c2ad4ff92ed1f 100644 --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -173,7 +173,7 @@ initImage: service: type: ClusterIP port: 8088 - targetPort: 8088 + servicePort: 8088 annotations: {} # cloud.google.com/load-balancer-type: "Internal" loadBalancerIP: null From 780e473bbe4b2eff9243c01db88764f9f9997712 Mon Sep 17 00:00:00 2001 From: sangarshanan Date: Mon, 21 Feb 2022 17:41:54 +0530 Subject: [PATCH 4/7] Remove redundant targetPort --- helm/superset/values.schema.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/helm/superset/values.schema.json b/helm/superset/values.schema.json index 315d1300834cc..d8ba8939ba40c 100644 --- a/helm/superset/values.schema.json +++ b/helm/superset/values.schema.json @@ -438,8 +438,7 @@ } }, "required": [ - "port", - "targetPort" + "port" ] }, "postgresqlUsername": { From f78946016356a4efcd4d98cd894992a82173cd2f Mon Sep 17 00:00:00 2001 From: sangarshanan Date: Tue, 22 Feb 2022 15:58:44 +0530 Subject: [PATCH 5/7] Add nginx and proxy fix --- helm/superset/templates/_helpers.tpl | 2 ++ helm/superset/templates/deployment.yaml | 10 ++++++++++ helm/superset/templates/service.yaml | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/helm/superset/templates/_helpers.tpl b/helm/superset/templates/_helpers.tpl index fb58de86d0b33..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') 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/service.yaml b/helm/superset/templates/service.yaml index 9fbbb8745b5a6..33ec437f377ae 100644 --- a/helm/superset/templates/service.yaml +++ b/helm/superset/templates/service.yaml @@ -31,7 +31,7 @@ spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.servicePort }} - targetPort: http + targetPort: 80 protocol: TCP name: https selector: From 129676bec1e85c6bd0446361240cfc37286548b0 Mon Sep 17 00:00:00 2001 From: Abhinesh Hada Date: Fri, 22 Jul 2022 14:31:43 +0530 Subject: [PATCH 6/7] upgrade postgres bitnami chart version --- helm/superset/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/superset/Chart.yaml b/helm/superset/Chart.yaml index 189ffcdb38a2d..2076f37545402 100644 --- a/helm/superset/Chart.yaml +++ b/helm/superset/Chart.yaml @@ -25,7 +25,7 @@ maintainers: version: 0.5.9 dependencies: - name: postgresql - version: 10.2.0 + version: 11.1.22 repository: https://charts.bitnami.com/bitnami condition: postgresql.enabled - name: redis From 84be0e730d96adf1cf775b0f2a01d433ae3a4a56 Mon Sep 17 00:00:00 2001 From: sangarshanan Date: Mon, 31 Oct 2022 23:26:14 +0530 Subject: [PATCH 7/7] Remove helm dependency --- helm/superset/Chart.yaml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/helm/superset/Chart.yaml b/helm/superset/Chart.yaml index 2076f37545402..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: 11.1.22 - repository: https://charts.bitnami.com/bitnami - condition: postgresql.enabled -- name: redis - version: 16.3.1 - repository: https://charts.bitnami.com/bitnami - condition: redis.enabled