You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/07/18 17:29:48 UTC

(superset) branch master updated: fix(helm): support initContainers in supersetWebsockets (#42201)

This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 0a66e4ea2d7 fix(helm): support initContainers in supersetWebsockets (#42201)
0a66e4ea2d7 is described below

commit 0a66e4ea2d7e40860fb726e7638f9901b7de415e
Author: David <39...@users.noreply.github.com>
AuthorDate: Sat Jul 18 19:29:42 2026 +0200

    fix(helm): support initContainers in supersetWebsockets (#42201)
---
 helm/superset/Chart.yaml                      |  2 +-
 helm/superset/README.md                       |  4 +++-
 helm/superset/templates/deployment-ws.yaml    |  9 ++++++++
 helm/superset/tests/init_containers_test.yaml | 19 ++++++++++++++++
 helm/superset/values.yaml                     | 32 +++++++++++++++++++++++++++
 5 files changed, 64 insertions(+), 2 deletions(-)

diff --git a/helm/superset/Chart.yaml b/helm/superset/Chart.yaml
index 8e22f068333..3fc06cd8bd2 100644
--- a/helm/superset/Chart.yaml
+++ b/helm/superset/Chart.yaml
@@ -29,7 +29,7 @@ maintainers:
   - name: craig-rueda
     email: craig@craigrueda.com
     url: https://github.com/craig-rueda
-version: 0.21.0 # See [README](https://github.com/apache/superset/blob/master/helm/superset/README.md#versioning) for version details.
+version: 0.21.1 # See [README](https://github.com/apache/superset/blob/master/helm/superset/README.md#versioning) for version details.
 dependencies:
   - name: postgresql
     version: 16.7.27
diff --git a/helm/superset/README.md b/helm/superset/README.md
index aca9c10073d..7597c575ed6 100644
--- a/helm/superset/README.md
+++ b/helm/superset/README.md
@@ -23,7 +23,7 @@ NOTE: This file is generated by helm-docs: https://github.com/norwoodj/helm-docs
 
 # superset
 
-![Version: 0.21.0](https://img.shields.io/badge/Version-0.21.0-informational?style=flat-square)
+![Version: 0.21.1](https://img.shields.io/badge/Version-0.21.1-informational?style=flat-square)
 
 Apache Superset is a modern, enterprise-ready business intelligence web application
 
@@ -305,11 +305,13 @@ Alternatively, perform a fresh install. This is a one-time migration; subsequent
 | supersetWebsockets.deploymentAnnotations | object | `{}` |  |
 | supersetWebsockets.enabled | bool | `false` | This is only required if you intend to use `GLOBAL_ASYNC_QUERIES` in `ws` mode see https://superset.apache.org/docs/contributing/misc#async-chart-queries |
 | supersetWebsockets.extraContainers | list | `[]` | Launch additional containers into supersetWebsockets pods |
+| supersetWebsockets.extraInitContainers | list | `[]` | Extra init containers appended after supersetWebsockets initContainers |
 | supersetWebsockets.image.pullPolicy | string | `"IfNotPresent"` |  |
 | supersetWebsockets.image.repository | string | `"oneacrefund/superset-websocket"` | There is no official image (yet), this one is community-supported |
 | supersetWebsockets.image.tag | string | `"latest"` |  |
 | supersetWebsockets.ingress.path | string | `"/ws"` |  |
 | supersetWebsockets.ingress.pathType | string | `"Prefix"` |  |
+| supersetWebsockets.initContainers | list | a container waiting for redis | List of initContainers |
 | supersetWebsockets.livenessProbe.failureThreshold | int | `3` |  |
 | supersetWebsockets.livenessProbe.httpGet.path | string | `"/health"` |  |
 | supersetWebsockets.livenessProbe.httpGet.port | string | `"ws"` |  |
diff --git a/helm/superset/templates/deployment-ws.yaml b/helm/superset/templates/deployment-ws.yaml
index 8968fe74a3b..efc6a2bf565 100644
--- a/helm/superset/templates/deployment-ws.yaml
+++ b/helm/superset/templates/deployment-ws.yaml
@@ -64,6 +64,15 @@ spec:
         {{- if .Values.supersetWebsockets.podSecurityContext }}
           {{- toYaml .Values.supersetWebsockets.podSecurityContext | nindent 8 }}
         {{- end }}
+      {{- if or .Values.supersetWebsockets.initContainers .Values.supersetWebsockets.extraInitContainers }}
+      initContainers:
+      {{- if .Values.supersetWebsockets.initContainers }}
+      {{- tpl (toYaml .Values.supersetWebsockets.initContainers) . | nindent 6 }}
+      {{- end }}
+      {{- if .Values.supersetWebsockets.extraInitContainers }}
+      {{- tpl (toYaml .Values.supersetWebsockets.extraInitContainers) . | nindent 6 }}
+      {{- end }}
+      {{- end }}
       {{- with .Values.hostAliases }}
       hostAliases: {{- toYaml . | nindent 6 }}
       {{- end }}
diff --git a/helm/superset/tests/init_containers_test.yaml b/helm/superset/tests/init_containers_test.yaml
index 58ec3535cf9..0068b54bfc9 100644
--- a/helm/superset/tests/init_containers_test.yaml
+++ b/helm/superset/tests/init_containers_test.yaml
@@ -20,6 +20,7 @@ templates:
   - deployment-worker.yaml
   - deployment-beat.yaml
   - deployment-flower.yaml
+  - deployment-ws.yaml
   - init-job.yaml
 tests:
   - it: renders only the default wait-for container by default
@@ -150,6 +151,24 @@ tests:
           path: spec.template.spec.initContainers[1].name
           value: prepare-assets
 
+  - it: appends websockets extraInitContainers after wait-for-redis
+    template: deployment-ws.yaml
+    set:
+      supersetWebsockets.enabled: true
+      supersetWebsockets.extraInitContainers:
+        - name: prepare-assets
+          image: busybox
+    asserts:
+      - lengthEqual:
+          path: spec.template.spec.initContainers
+          count: 2
+      - equal:
+          path: spec.template.spec.initContainers[0].name
+          value: wait-for-redis
+      - equal:
+          path: spec.template.spec.initContainers[1].name
+          value: prepare-assets
+
   - it: appends init job extraInitContainers after wait-for-postgres
     template: init-job.yaml
     set:
diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml
index 785a71e85b4..52c4ee7f596 100644
--- a/helm/superset/values.yaml
+++ b/helm/superset/values.yaml
@@ -867,6 +867,38 @@ supersetWebsockets:
       # -- (int)
       http: nil
   command: []
+  # -- List of initContainers
+  # @default -- a container waiting for redis
+  initContainers:
+    - name: wait-for-redis
+      image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
+      imagePullPolicy: "{{ .Values.image.pullPolicy }}"
+      envFrom:
+        - secretRef:
+            name: "{{ tpl .Values.envFromSecret . }}"
+      command:
+        - /bin/bash
+        - -c
+        - |
+          # See supersetNode.initContainers for the rationale.
+          SECONDS=0
+          until (exec 3<>/dev/tcp/"$REDIS_HOST"/"$REDIS_PORT") 2>/dev/null; do
+            if [ "$SECONDS" -ge 120 ]; then
+              echo "timeout waiting for redis at $REDIS_HOST:$REDIS_PORT after 120s" >&2
+              exit 1
+            fi
+            echo "waiting for redis at $REDIS_HOST:$REDIS_PORT (elapsed ${SECONDS}s)"
+            sleep 2
+          done
+          echo "redis at $REDIS_HOST:$REDIS_PORT is up"
+      resources:
+        limits:
+          memory: "256Mi"
+        requests:
+          cpu: "250m"
+          memory: "128Mi"
+  # -- Extra init containers appended after supersetWebsockets initContainers
+  extraInitContainers: []
   resources: {}
   # -- Launch additional containers into supersetWebsockets pods
   extraContainers: []