From d75cf76f3778799b33263f1728707bc8e452079f Mon Sep 17 00:00:00 2001 From: Yann Jouanique Date: Thu, 13 Oct 2022 22:29:15 +0200 Subject: [PATCH 01/12] Chart updates --- helm/superset/Chart.lock | 9 + helm/superset/Chart.yaml | 25 +- helm/superset/README.md | 216 ++++++++++ helm/superset/README.md.gotmpl | 21 + helm/superset/templates/deployment-beat.yaml | 83 +++- .../superset/templates/deployment-worker.yaml | 38 +- helm/superset/templates/deployment-ws.yaml | 137 ++++++ helm/superset/templates/deployment.yaml | 54 ++- helm/superset/templates/ingress.yaml | 9 + helm/superset/templates/secret-ws.yaml | 31 ++ helm/superset/templates/service.yaml | 58 +++ .../{values.schema.json => toto.json} | 0 helm/superset/values.yaml | 397 +++++++++++++----- 13 files changed, 913 insertions(+), 165 deletions(-) create mode 100644 helm/superset/Chart.lock create mode 100644 helm/superset/README.md create mode 100644 helm/superset/README.md.gotmpl create mode 100644 helm/superset/templates/deployment-ws.yaml create mode 100644 helm/superset/templates/secret-ws.yaml rename helm/superset/{values.schema.json => toto.json} (100%) diff --git a/helm/superset/Chart.lock b/helm/superset/Chart.lock new file mode 100644 index 0000000000000..6ae53c9f8db88 --- /dev/null +++ b/helm/superset/Chart.lock @@ -0,0 +1,9 @@ +dependencies: +- name: postgresql + repository: https://charts.bitnami.com/bitnami + version: 11.1.22 +- name: redis + repository: https://charts.bitnami.com/bitnami + version: 16.3.1 +digest: sha256:f80cc4ec2bb6f327d348bc15e9192cc6ab2163781c1e35f85720565a36a1cb14 +generated: "2022-10-13T16:59:44.305764+02:00" diff --git a/helm/superset/Chart.yaml b/helm/superset/Chart.yaml index ef017b70f9ce5..41b3546666360 100644 --- a/helm/superset/Chart.yaml +++ b/helm/superset/Chart.yaml @@ -18,17 +18,24 @@ apiVersion: v2 appVersion: "1.0" description: Apache Superset is a modern, enterprise-ready business intelligence web application name: superset +home: https://superset.apache.org/ +icon: https://avatars.githubusercontent.com/u/5543677?s=400&v=4 +keywords: + - business intelligence + - data science +sources: + - https://github.com/apache/superset maintainers: - name: craig-rueda email: craig@craigrueda.com url: https://github.com/craig-rueda -version: 0.7.4 +version: 0.7.5 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 + - 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 diff --git a/helm/superset/README.md b/helm/superset/README.md new file mode 100644 index 0000000000000..6c8754454b491 --- /dev/null +++ b/helm/superset/README.md @@ -0,0 +1,216 @@ +# superset + +![Version: 0.7.5](https://img.shields.io/badge/Version-0.7.5-informational?style=flat-square) + +Apache Superset is a modern, enterprise-ready business intelligence web application + +## TL;DR; + +```console +helm repo add superset http://apache.github.io/superset/ +helm install my-superset superset/superset +``` + +## Requirements + +| Repository | Name | Version | +|------------|------|---------| +| https://charts.bitnami.com/bitnami | postgresql | 11.1.22 | +| https://charts.bitnami.com/bitnami | redis | 16.3.1 | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| bootstrapScript | string | see `values.yaml` | Install additional packages and do any other bootstrap configuration in this script For production clusters it's recommended to build own image with this step done in CI | +| configFromSecret | string | `"{{ template \"superset.fullname\" . }}-config"` | The name of the secret which we will use to generate a superset_config.py file Note: this secret must have the key superset_config.py in it and can include other files as well | +| configMountPath | string | `"/app/pythonpath"` | | +| configOverrides | object | `{}` | A dictionary of overrides to append at the end of superset_config.py - the name does not matter WARNING: the order is not guaranteed Files can be passed as helm --set-file configOverrides.my-override=my-file.py | +| configOverridesFiles | object | `{}` | Same as above but the values are files | +| envFromSecret | string | `"{{ template \"superset.fullname\" . }}-env"` | The name of the secret which we will use to populate env vars in deployed pods This can be useful for secret keys, etc. | +| envFromSecrets | list | `[]` | This can be a list of templated strings | +| extraConfigMountPath | string | `"/app/configs"` | | +| extraConfigs | object | `{}` | Extra files to mount on `/app/pythonpath` | +| extraEnv | object | `{}` | Extra environment variables that will be passed into pods | +| extraEnvRaw | list | `[]` | Extra environment variables in RAW format that will be passed into pods | +| extraSecretEnv | object | `{}` | Extra environment variables to pass as secrets | +| extraSecrets | object | `{}` | Extra files to mount on `/app/pythonpath` as secrets | +| extraVolumeMounts | list | `[]` | | +| extraVolumes | list | `[]` | | +| hostAliases | list | `[]` | Custom hostAliases for all superset pods # https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/ | +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.repository | string | `"apache/superset"` | | +| image.tag | string | `"latest"` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | object | `{}` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts[0] | string | `"chart-example.local"` | | +| ingress.path | string | `"/"` | | +| ingress.pathType | string | `"ImplementationSpecific"` | | +| ingress.tls | list | `[]` | | +| init.adminUser.email | string | `"admin@superset.com"` | | +| init.adminUser.firstname | string | `"Superset"` | | +| init.adminUser.lastname | string | `"Admin"` | | +| init.adminUser.password | string | `"admin"` | | +| init.adminUser.username | string | `"admin"` | | +| init.command | list | a `superset_init.sh` command | Command | +| init.containerSecurityContext | object | `{}` | | +| init.createAdmin | bool | `true` | | +| init.enabled | bool | `true` | | +| init.initContainers | list | a container waiting for postgres | List of initContainers | +| init.initscript | string | a script to create admin user and initailize roles | A Superset init script | +| init.loadExamples | bool | `false` | | +| init.podAnnotations | object | `{}` | | +| init.podSecurityContext | object | `{}` | | +| init.resources | object | `{}` | | +| initImage.pullPolicy | string | `"IfNotPresent"` | | +| initImage.repository | string | `"busybox"` | | +| initImage.tag | string | `"latest"` | | +| nodeSelector | object | `{}` | | +| postgresql | object | see `values.yaml` | Configuration values for the postgresql dependency. ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md | +| redis | object | see `values.yaml` | Configuration values for the Redis dependency. ref: https://github.com/bitnami/charts/blob/master/bitnami/redis More documentation can be found here: https://artifacthub.io/packages/helm/bitnami/redis | +| resources | object | `{}` | | +| runAsUser | int | `0` | User ID directive. This user must have enough permissions to run the bootstrap script Running containers as root is not recommended in production. Change this to another UID - e.g. 1000 to be more secure | +| service.annotations | object | `{}` | | +| service.loadBalancerIP | string | `nil` | | +| service.port | int | `8088` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.create | bool | `false` | Create custom service account for Superset. If create: true and name is not provided, `superset.fullname` will be used. | +| supersetCeleryBeat.command | list | a port wait command | Command | +| supersetCeleryBeat.containerSecurityContext | object | `{}` | | +| supersetCeleryBeat.deploymentAnnotations | object | `{}` | Annotations to be added to supersetCeleryBeat deployment | +| supersetCeleryBeat.enabled | bool | `false` | This is only required if you intend to use alerts and reports | +| supersetCeleryBeat.flower.command | list | a `celery flower` command | Command | +| supersetCeleryBeat.flower.enabled | bool | `false` | If true, will expose a web-based UI to monitor jobs WARNING: requires a Superset image that has `flower<1.0.0` installed (which is NOT the case of the default images) flower>=1.0.0 requires Celery 5+ which Superset does not support | +| supersetCeleryBeat.flower.livenessProbe.failureThreshold | int | `3` | | +| supersetCeleryBeat.flower.livenessProbe.httpGet.path | string | `"/api/workers"` | | +| supersetCeleryBeat.flower.livenessProbe.httpGet.port | string | `"flower"` | | +| supersetCeleryBeat.flower.livenessProbe.initialDelaySeconds | int | `5` | | +| supersetCeleryBeat.flower.livenessProbe.periodSeconds | int | `5` | | +| supersetCeleryBeat.flower.livenessProbe.successThreshold | int | `1` | | +| supersetCeleryBeat.flower.livenessProbe.timeoutSeconds | int | `1` | | +| supersetCeleryBeat.flower.readinessProbe.failureThreshold | int | `3` | | +| supersetCeleryBeat.flower.readinessProbe.httpGet.path | string | `"/api/workers"` | | +| supersetCeleryBeat.flower.readinessProbe.httpGet.port | string | `"flower"` | | +| supersetCeleryBeat.flower.readinessProbe.initialDelaySeconds | int | `5` | | +| supersetCeleryBeat.flower.readinessProbe.periodSeconds | int | `5` | | +| supersetCeleryBeat.flower.readinessProbe.successThreshold | int | `1` | | +| supersetCeleryBeat.flower.readinessProbe.timeoutSeconds | int | `1` | | +| supersetCeleryBeat.flower.service.annotations | object | `{}` | | +| supersetCeleryBeat.flower.service.port | int | `5555` | | +| supersetCeleryBeat.flower.service.type | string | `"ClusterIP"` | | +| supersetCeleryBeat.flower.startupProbe.failureThreshold | int | `60` | | +| supersetCeleryBeat.flower.startupProbe.httpGet.path | string | `"/api/workers"` | | +| supersetCeleryBeat.flower.startupProbe.httpGet.port | string | `"flower"` | | +| supersetCeleryBeat.flower.startupProbe.initialDelaySeconds | int | `5` | | +| supersetCeleryBeat.flower.startupProbe.periodSeconds | int | `5` | | +| supersetCeleryBeat.flower.startupProbe.successThreshold | int | `1` | | +| supersetCeleryBeat.flower.startupProbe.timeoutSeconds | int | `1` | | +| supersetCeleryBeat.forceReload | bool | `false` | If true, forces deployment to reload on each upgrade | +| supersetCeleryBeat.initContainers | list | a container waiting for postgres | List of init containers | +| supersetCeleryBeat.podAnnotations | object | `{}` | Annotations to be added to supersetCeleryBeat pods | +| supersetCeleryBeat.podLabels | object | `{}` | Labels to be added to supersetCeleryBeat pods | +| supersetCeleryBeat.podSecurityContext | object | `{}` | | +| supersetCeleryBeat.resources | object | `{}` | Resource settings for the CeleryBeat pods - these settings overwrite might existing values from the global resources object defined above. | +| supersetNode.command | list | See `values.yaml` | Startup command | +| supersetNode.connections.db_host | string | `"{{ template \"superset.fullname\" . }}-postgresql"` | | +| supersetNode.connections.db_name | string | `"superset"` | | +| supersetNode.connections.db_pass | string | `"superset"` | | +| supersetNode.connections.db_port | string | `"5432"` | | +| supersetNode.connections.db_user | string | `"superset"` | | +| supersetNode.connections.redis_host | string | `"{{ template \"superset.fullname\" . }}-redis-headless"` | Change in case of bringing your own redis and then also set redis.enabled:false | +| supersetNode.connections.redis_port | string | `"6379"` | | +| supersetNode.containerSecurityContext | object | `{}` | | +| supersetNode.deploymentAnnotations | object | `{}` | Annotations to be added to supersetNode deployment | +| supersetNode.env | object | `{}` | | +| supersetNode.forceReload | bool | `false` | If true, forces deployment to reload on each upgrade | +| supersetNode.initContainers | list | a container waiting for postgres to be up | Init containers | +| supersetNode.livenessProbe.failureThreshold | int | `3` | | +| supersetNode.livenessProbe.httpGet.path | string | `"/health"` | | +| supersetNode.livenessProbe.httpGet.port | string | `"http"` | | +| supersetNode.livenessProbe.initialDelaySeconds | int | `15` | | +| supersetNode.livenessProbe.periodSeconds | int | `15` | | +| supersetNode.livenessProbe.successThreshold | int | `1` | | +| supersetNode.livenessProbe.timeoutSeconds | int | `1` | | +| supersetNode.podAnnotations | object | `{}` | Annotations to be added to supersetNode pods | +| supersetNode.podLabels | object | `{}` | Labels to be added to supersetNode pods | +| supersetNode.podSecurityContext | object | `{}` | | +| supersetNode.readinessProbe.failureThreshold | int | `3` | | +| supersetNode.readinessProbe.httpGet.path | string | `"/health"` | | +| supersetNode.readinessProbe.httpGet.port | string | `"http"` | | +| supersetNode.readinessProbe.initialDelaySeconds | int | `15` | | +| supersetNode.readinessProbe.periodSeconds | int | `15` | | +| supersetNode.readinessProbe.successThreshold | int | `1` | | +| supersetNode.readinessProbe.timeoutSeconds | int | `1` | | +| supersetNode.replicaCount | int | `1` | | +| supersetNode.resources | object | `{}` | Resource settings for the supersetNode pods - these settings overwrite might existing values from the global resources object defined above. | +| supersetNode.startupProbe.failureThreshold | int | `60` | | +| supersetNode.startupProbe.httpGet.path | string | `"/health"` | | +| supersetNode.startupProbe.httpGet.port | string | `"http"` | | +| supersetNode.startupProbe.initialDelaySeconds | int | `15` | | +| supersetNode.startupProbe.periodSeconds | int | `5` | | +| supersetNode.startupProbe.successThreshold | int | `1` | | +| supersetNode.startupProbe.timeoutSeconds | int | `1` | | +| supersetNode.strategy | object | `{}` | | +| supersetWebsockets.command | list | `[]` | | +| supersetWebsockets.config | object | see `values.yaml` | The config.json to pass to the server, see https://github.com/apache/superset/tree/master/superset-websocket Note that the configuration can also read from environment variables (which will have priority), see https://github.com/apache/superset/blob/master/superset-websocket/src/config.ts for a list of supported variables | +| supersetWebsockets.containerSecurityContext | object | `{}` | | +| supersetWebsockets.deploymentAnnotations | object | `{}` | | +| supersetWebsockets.enabled | bool | `false` | This is only required if you intend to use `GLOBAL_ASYNC_QUERIES` in `ws` mode see https://github.com/apache/superset/blob/master/CONTRIBUTING.md#async-chart-queries | +| supersetWebsockets.image.pullPolicy | string | `"IfNotPresent"` | | +| supersetWebsockets.image.repository | string | `"immobisolusiprima/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.livenessProbe.failureThreshold | int | `3` | | +| supersetWebsockets.livenessProbe.httpGet.path | string | `"/health"` | | +| supersetWebsockets.livenessProbe.httpGet.port | string | `"ws"` | | +| supersetWebsockets.livenessProbe.initialDelaySeconds | int | `5` | | +| supersetWebsockets.livenessProbe.periodSeconds | int | `5` | | +| supersetWebsockets.livenessProbe.successThreshold | int | `1` | | +| supersetWebsockets.livenessProbe.timeoutSeconds | int | `1` | | +| supersetWebsockets.podAnnotations | object | `{}` | | +| supersetWebsockets.podLabels | object | `{}` | | +| supersetWebsockets.podSecurityContext | object | `{}` | | +| supersetWebsockets.readinessProbe.failureThreshold | int | `3` | | +| supersetWebsockets.readinessProbe.httpGet.path | string | `"/health"` | | +| supersetWebsockets.readinessProbe.httpGet.port | string | `"ws"` | | +| supersetWebsockets.readinessProbe.initialDelaySeconds | int | `5` | | +| supersetWebsockets.readinessProbe.periodSeconds | int | `5` | | +| supersetWebsockets.readinessProbe.successThreshold | int | `1` | | +| supersetWebsockets.readinessProbe.timeoutSeconds | int | `1` | | +| supersetWebsockets.replicaCount | int | `1` | | +| supersetWebsockets.resources | object | `{}` | | +| supersetWebsockets.service.annotations | object | `{}` | | +| supersetWebsockets.service.port | int | `8080` | | +| supersetWebsockets.service.type | string | `"ClusterIP"` | | +| supersetWebsockets.startupProbe.failureThreshold | int | `60` | | +| supersetWebsockets.startupProbe.httpGet.path | string | `"/health"` | | +| supersetWebsockets.startupProbe.httpGet.port | string | `"ws"` | | +| supersetWebsockets.startupProbe.initialDelaySeconds | int | `5` | | +| supersetWebsockets.startupProbe.periodSeconds | int | `5` | | +| supersetWebsockets.startupProbe.successThreshold | int | `1` | | +| supersetWebsockets.startupProbe.timeoutSeconds | int | `1` | | +| supersetWebsockets.strategy | object | `{}` | | +| supersetWorker.command | list | a `celery worker` command | Worker startup command | +| supersetWorker.containerSecurityContext | object | `{}` | | +| supersetWorker.deploymentAnnotations | object | `{}` | Annotations to be added to supersetWorker deployment | +| supersetWorker.forceReload | bool | `false` | If true, forces deployment to reload on each upgrade | +| supersetWorker.initContainers | list | a container waiting for postgres | Init container | +| supersetWorker.livenessProbe.exec.command | list | a `celery inspect ping` command | Liveness probe command | +| supersetWorker.livenessProbe.failureThreshold | int | `3` | | +| supersetWorker.livenessProbe.initialDelaySeconds | int | `120` | | +| supersetWorker.livenessProbe.periodSeconds | int | `60` | | +| supersetWorker.livenessProbe.successThreshold | int | `1` | | +| supersetWorker.livenessProbe.timeoutSeconds | int | `60` | | +| supersetWorker.podAnnotations | object | `{}` | Annotations to be added to supersetWorker pods | +| supersetWorker.podLabels | object | `{}` | Labels to be added to supersetWorker pods | +| supersetWorker.podSecurityContext | object | `{}` | | +| supersetWorker.readinessProbe | object | `{}` | No startup/readiness probes by default since we don't really care about its startup time (it doesn't serve traffic) | +| supersetWorker.replicaCount | int | `1` | | +| supersetWorker.resources | object | `{}` | Resource settings for the supersetWorker pods - these settings overwrite might existing values from the global resources object defined above. | +| supersetWorker.startupProbe | object | `{}` | No startup/readiness probes by default since we don't really care about its startup time (it doesn't serve traffic) | +| supersetWorker.strategy | object | `{}` | | +| tolerations | list | `[]` | | diff --git a/helm/superset/README.md.gotmpl b/helm/superset/README.md.gotmpl new file mode 100644 index 0000000000000..78881165c9f87 --- /dev/null +++ b/helm/superset/README.md.gotmpl @@ -0,0 +1,21 @@ +{{ template "chart.header" . }} +{{ template "chart.deprecationWarning" . }} + +{{ template "chart.versionBadge" . }} + +{{ template "chart.description" . }} + +{{ template "chart.homepageLine" . }} + +{{ template "chart.sourcesSection" . }} + +## TL;DR; + +```console +helm repo add superset http://apache.github.io/superset/ +helm install my-superset superset/superset +``` + +{{ template "chart.requirementsSection" . }} + +{{ template "chart.valuesSection" . }} diff --git a/helm/superset/templates/deployment-beat.yaml b/helm/superset/templates/deployment-beat.yaml index 31840f1484a2e..2b1161c0d8469 100644 --- a/helm/superset/templates/deployment-beat.yaml +++ b/helm/superset/templates/deployment-beat.yaml @@ -53,7 +53,7 @@ spec: {{ toYaml .Values.supersetCeleryBeat.podAnnotations | nindent 8 }} {{- end }} labels: - app: {{ template "superset.name" . }}-celerybeat + app: "{{ template "superset.name" . }}-celerybeat" release: {{ .Release.Name }} {{- if .Values.supersetCeleryBeat.podLabels }} {{ toYaml .Values.supersetCeleryBeat.podLabels | nindent 8 }} @@ -75,7 +75,7 @@ spec: hostAliases: {{ toYaml . | nindent 6 }} {{- end }} containers: - - name: {{ .Chart.Name }} + - name: "{{ .Chart.Name }}-celerybeat" image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.supersetCeleryBeat.containerSecurityContext }} @@ -108,25 +108,78 @@ spec: {{- end }} resources: {{- if .Values.supersetCeleryBeat.resources }} -{{ toYaml .Values.supersetCeleryBeat.resources | indent 12 }} + {{- toYaml .Values.supersetCeleryBeat.resources | nindent 12 }} {{- else }} -{{ toYaml .Values.resources | indent 12 }} + {{- toYaml .Values.resources | nindent 12 }} {{- end }} - {{- with .Values.nodeSelector }} + {{- if .Values.supersetCeleryBeat.flower.enabled }} + - name: "{{ .Chart.Name }}-flower" + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.supersetCeleryBeat.containerSecurityContext }} + securityContext: {{ toYaml .Values.supersetCeleryBeat.containerSecurityContext | nindent 12 }} + {{- end }} + command: {{ tpl (toJson .Values.supersetCeleryBeat.flower.command) . }} + env: + {{- range $key, $value := .Values.extraEnv }} + - name: {{ $key | quote}} + value: {{ $value | quote }} + {{- end }} + {{- if .Values.extraEnvRaw }} + {{- toYaml .Values.extraEnvRaw | nindent 12 }} + {{- end }} + envFrom: + - secretRef: + name: {{ tpl .Values.envFromSecret . | quote }} + {{- range .Values.envFromSecrets }} + - secretRef: + name: {{ tpl . $ | quote }} + {{- end }} + ports: + - name: flower + containerPort: 5555 + protocol: TCP + volumeMounts: + - name: superset-config + mountPath: {{ .Values.configMountPath | quote }} + readOnly: true + {{- with .Values.extraVolumeMounts }} + {{- tpl (toYaml .) $ | nindent 12 -}} + {{- end }} + {{- if .Values.supersetCeleryBeat.flower.startupProbe }} + startupProbe: + {{- .Values.supersetCeleryBeat.flower.startupProbe | toYaml | nindent 12 }} + {{- end }} + {{- if .Values.supersetCeleryBeat.flower.readinessProbe }} + readinessProbe: + {{- .Values.supersetCeleryBeat.flower.readinessProbe | toYaml | nindent 12 }} + {{- end }} + {{- if .Values.supersetCeleryBeat.flower.livenessProbe }} + livenessProbe: + {{- .Values.supersetCeleryBeat.flower.livenessProbe | toYaml | nindent 12 }} + {{- end }} + resources: + {{- if .Values.supersetCeleryBeat.resources }} + {{- toYaml .Values.supersetCeleryBeat.resources | nindent 12 }} + {{- else }} + {{- toYaml .Values.resources | nindent 12 }} + {{- end }} + {{- end }} + {{- with .Values.nodeSelector }} nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.affinity }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.tolerations }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} tolerations: -{{ toYaml . | indent 8 }} - {{- end }} -{{- if .Values.imagePullSecrets }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- if .Values.imagePullSecrets }} imagePullSecrets: -{{ toYaml .Values.imagePullSecrets | indent 8 }} + {{- toYaml .Values.imagePullSecrets | nindent 8 }} {{- end }} volumes: - name: superset-config diff --git a/helm/superset/templates/deployment-worker.yaml b/helm/superset/templates/deployment-worker.yaml index 7d79f2edbfb46..f11cba46904af 100644 --- a/helm/superset/templates/deployment-worker.yaml +++ b/helm/superset/templates/deployment-worker.yaml @@ -113,27 +113,39 @@ spec: {{- with .Values.extraVolumeMounts }} {{- tpl (toYaml .) $ | nindent 12 -}} {{- end }} + {{- if .Values.supersetWorker.startupProbe }} + startupProbe: + {{- .Values.supersetWorker.startupProbe | toYaml | nindent 12 }} + {{- end }} + {{- if .Values.supersetWorker.readinessProbe }} + readinessProbe: + {{- .Values.supersetWorker.readinessProbe | toYaml | nindent 12 }} + {{- end }} + {{- if .Values.supersetWorker.livenessProbe }} + livenessProbe: + {{- .Values.supersetWorker.livenessProbe | toYaml | nindent 12 }} + {{- end }} resources: {{- if .Values.supersetWorker.resources }} -{{ toYaml .Values.supersetWorker.resources | indent 12 }} + {{- toYaml .Values.supersetWorker.resources | nindent 12 }} {{- else }} -{{ toYaml .Values.resources | indent 12 }} + {{- toYaml .Values.resources | nindent 12 }} {{- end }} - {{- with .Values.nodeSelector }} + {{- with .Values.nodeSelector }} nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.affinity }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.tolerations }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} tolerations: -{{ toYaml . | indent 8 }} - {{- end }} -{{- if .Values.imagePullSecrets }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- if .Values.imagePullSecrets }} imagePullSecrets: -{{ toYaml .Values.imagePullSecrets | indent 8 }} + {{- toYaml .Values.imagePullSecrets | nindent 8 }} {{- end }} volumes: - name: superset-config diff --git a/helm/superset/templates/deployment-ws.yaml b/helm/superset/templates/deployment-ws.yaml new file mode 100644 index 0000000000000..5ae5b26943a66 --- /dev/null +++ b/helm/superset/templates/deployment-ws.yaml @@ -0,0 +1,137 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +{{- if .Values.supersetWebsockets.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ template "superset.fullname" . }}-ws" + labels: + app: "{{ template "superset.name" . }}-ws" + chart: {{ template "superset.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- if .Values.supersetWebsockets.deploymentAnnotations }} + annotations: + {{ toYaml .Values.supersetWebsockets.deploymentAnnotations | nindent 4 }} +{{- end }} +spec: + replicas: {{ .Values.supersetWebsockets.replicaCount }} + selector: + matchLabels: + app: "{{ template "superset.name" . }}-ws" + release: {{ .Release.Name }} + {{- if .Values.supersetWebsockets.strategy }} + strategy: + {{- toYaml .Values.supersetWebsockets.strategy | nindent 4 }} + {{- end }} + template: + metadata: + annotations: + checksum/wsconfig: {{ tpl (toJson .Values.supersetWebsockets.config) . | sha256sum }} + {{- if .Values.supersetWebsockets.podAnnotations }} + {{ toYaml .Values.supersetWebsockets.podAnnotations | nindent 8 }} + {{- end }} + labels: + app: "{{ template "superset.name" . }}-ws" + release: {{ .Release.Name }} + {{- if .Values.supersetWebsockets.podLabels }} + {{ toYaml .Values.supersetWebsockets.podLabels | nindent 8 }} + {{- end }} + spec: + {{- if or (.Values.serviceAccount.create) (.Values.serviceAccountName) }} + serviceAccountName: {{ template "superset.serviceAccountName" . }} + {{- end }} + securityContext: + runAsUser: {{ .Values.runAsUser }} + {{- if .Values.supersetWebsockets.podSecurityContext }} + {{ toYaml .Values.supersetWebsockets.podSecurityContext | nindent 8 }} + {{- end }} + {{- with .Values.hostAliases }} + hostAliases: {{ toYaml . | nindent 6 }} + {{- end }} + containers: + - name: "{{ .Chart.Name }}-ws" + image: "{{ .Values.supersetWebsockets.image.repository }}:{{ .Values.supersetWebsockets.image.tag }}" + imagePullPolicy: {{ .Values.supersetWebsockets.image.pullPolicy }} + {{- if .Values.supersetWebsockets.containerSecurityContext }} + securityContext: {{ toYaml .Values.supersetWebsockets.containerSecurityContext | nindent 12 }} + {{- end }} + command: {{ tpl (toJson .Values.supersetWebsockets.command) . }} + # Passing all the envs is a bit blunt... we only need a few (see https://github.com/apache/superset/blob/master/superset-websocket/src/config.ts)... + env: + {{- range $key, $value := .Values.extraEnv }} + - name: {{ $key | quote}} + value: {{ $value | quote }} + {{- end }} + {{- if .Values.extraEnvRaw }} + {{- toYaml .Values.extraEnvRaw | nindent 12 }} + {{- end }} + envFrom: + - secretRef: + name: {{ tpl .Values.envFromSecret . | quote }} + {{- range .Values.envFromSecrets }} + - secretRef: + name: {{ tpl . $ | quote }} + {{- end }} + ports: + - name: ws + containerPort: {{ .Values.supersetWebsockets.config.port }} + protocol: TCP + volumeMounts: + - name: superset-ws-config + mountPath: /home/superset-websocket/config.json + subPath: config.json + readOnly: true + resources: + {{- if .Values.supersetWebsockets.resources }} + {{- toYaml .Values.supersetWebsockets.resources | nindent 12 }} + {{- else }} + {{- toYaml .Values.resources | nindent 12 }} + {{- end }} + {{- if .Values.supersetWebsockets.startupProbe }} + startupProbe: + {{- .Values.supersetWebsockets.startupProbe | toYaml | nindent 12 }} + {{- end }} + {{- if .Values.supersetWebsockets.readinessProbe }} + readinessProbe: + {{- .Values.supersetWebsockets.readinessProbe | toYaml | nindent 12 }} + {{- end }} + {{- if .Values.supersetWebsockets.livenessProbe }} + livenessProbe: + {{- .Values.supersetWebsockets.livenessProbe | toYaml | nindent 12 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- if .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml .Values.imagePullSecrets | nindent 8 }} + {{- end }} + volumes: + - name: superset-ws-config + secret: + secretName: "{{ template "superset.fullname" . }}-ws-config" +{{- end }} diff --git a/helm/superset/templates/deployment.yaml b/helm/superset/templates/deployment.yaml index 3388fcc72c3eb..b9ef2052e1708 100644 --- a/helm/superset/templates/deployment.yaml +++ b/helm/superset/templates/deployment.yaml @@ -124,45 +124,39 @@ spec: - name: http containerPort: {{ .Values.service.port }} protocol: TCP - livenessProbe: - httpGet: - path: /health - port: http - initialDelaySeconds: {{ .Values.supersetNode.livenessProbe.initialDelaySeconds }} - timeoutSeconds: {{ .Values.supersetNode.livenessProbe.timeoutSeconds }} - failureThreshold: {{ .Values.supersetNode.livenessProbe.failureThreshold }} - periodSeconds: {{ .Values.supersetNode.livenessProbe.periodSeconds }} - successThreshold: {{ .Values.supersetNode.livenessProbe.successThreshold }} + {{- if .Values.supersetNode.startupProbe }} + startupProbe: + {{- .Values.supersetNode.startupProbe | toYaml | nindent 12 }} + {{- end }} + {{- if .Values.supersetNode.readinessProbe }} readinessProbe: - httpGet: - path: /health - port: http - initialDelaySeconds: {{ .Values.supersetNode.readinessProbe.initialDelaySeconds }} - timeoutSeconds: {{ .Values.supersetNode.readinessProbe.timeoutSeconds }} - failureThreshold: {{ .Values.supersetNode.readinessProbe.failureThreshold }} - periodSeconds: {{ .Values.supersetNode.readinessProbe.periodSeconds }} - successThreshold: {{ .Values.supersetNode.readinessProbe.successThreshold }} + {{- .Values.supersetNode.readinessProbe | toYaml | nindent 12 }} + {{- end }} + {{- if .Values.supersetNode.livenessProbe }} + livenessProbe: + {{- .Values.supersetNode.livenessProbe | toYaml | nindent 12 }} + {{- end }} resources: {{- if .Values.supersetNode.resources }} -{{ toYaml .Values.supersetNode.resources | indent 12 }} + {{- toYaml .Values.supersetNode.resources | nindent 12 }} {{- else }} -{{ toYaml .Values.resources | indent 12 }} + {{- toYaml .Values.resources | nindent 12 }} {{- end }} - {{- with .Values.nodeSelector }} + {{- with .Values.nodeSelector }} nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.affinity }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.tolerations }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} tolerations: -{{ toYaml . | indent 8 }} - {{- end }} -{{- if .Values.imagePullSecrets }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- if .Values.imagePullSecrets }} imagePullSecrets: -{{ toYaml .Values.imagePullSecrets | indent 8 }} + {{- toYaml .Values.imagePullSecrets | nindent 8 }} {{- end }} volumes: diff --git a/helm/superset/templates/ingress.yaml b/helm/superset/templates/ingress.yaml index 2a151ccc2e3e9..e003b8153f2a7 100644 --- a/helm/superset/templates/ingress.yaml +++ b/helm/superset/templates/ingress.yaml @@ -55,5 +55,14 @@ spec: name: {{ $fullName }} port: name: http + {{- if $.Values.supersetWebsockets.enabled }} + - path: {{ $.Values.supersetWebsockets.ingress.path }} + pathType: {{ $.Values.supersetWebsockets.ingress.pathType }} + backend: + service: + name: "{{ template "superset.fullname" $ }}-ws" + port: + name: ws + {{- end }} {{- end }} {{- end }} diff --git a/helm/superset/templates/secret-ws.yaml b/helm/superset/templates/secret-ws.yaml new file mode 100644 index 0000000000000..0e48e0377e591 --- /dev/null +++ b/helm/superset/templates/secret-ws.yaml @@ -0,0 +1,31 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +{{- if .Values.supersetWebsockets.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: "{{ template "superset.fullname" . }}-ws-config" + labels: + app: {{ template "superset.fullname" . }} + chart: {{ template "superset.chart" . }} + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +type: Opaque +stringData: + config.json: | + {{- tpl (toJson .Values.supersetWebsockets.config) . | nindent 6 }} +{{- end }} diff --git a/helm/superset/templates/service.yaml b/helm/superset/templates/service.yaml index 0124ad2a9d04a..83dd3fb494655 100644 --- a/helm/superset/templates/service.yaml +++ b/helm/superset/templates/service.yaml @@ -40,3 +40,61 @@ spec: {{- if .Values.service.loadBalancerIP }} loadBalancerIP: {{ .Values.service.loadBalancerIP }} {{- end }} +--- +{{- if .Values.supersetCeleryBeat.flower.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: "{{ template "superset.fullname" . }}-flower" + labels: + app: {{ template "superset.name" . }} + chart: {{ template "superset.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.supersetCeleryBeat.flower.service.annotations }} + annotations: +{{- toYaml . | nindent 4 }} +{{- end }} +spec: + type: {{ .Values.supersetCeleryBeat.flower.service.type }} + ports: + - port: {{ .Values.supersetCeleryBeat.flower.service.port }} + targetPort: flower + protocol: TCP + name: flower + selector: + app: {{ template "superset.name" . }}-celerybeat + release: {{ .Release.Name }} + {{- if .Values.supersetCeleryBeat.flower.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.supersetCeleryBeat.flower.service.loadBalancerIP }} + {{- end }} +{{- end }} +--- +{{- if .Values.supersetWebsockets.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: "{{ template "superset.fullname" . }}-ws" + labels: + app: {{ template "superset.name" . }} + chart: {{ template "superset.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + {{- with .Values.supersetWebsockets.service.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + type: {{ .Values.supersetWebsockets.service.type }} + ports: + - port: {{ .Values.supersetWebsockets.service.port }} + targetPort: ws + protocol: TCP + name: ws + selector: + app: "{{ template "superset.name" . }}-ws" + release: {{ .Release.Name }} + {{- if .Values.supersetWebsockets.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.supersetWebsockets.service.loadBalancerIP }} + {{- end }} +{{- end }} diff --git a/helm/superset/values.schema.json b/helm/superset/toto.json similarity index 100% rename from helm/superset/values.schema.json rename to helm/superset/toto.json diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml index 00a0916227351..617893fb849e1 100644 --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -19,18 +19,19 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -# User ID directive. This user must have enough permissions to run the bootstrap script -# Runn containers as root is not recommended in production. Change this to another UID - e.g. 1000 to be more secure +# -- User ID directive. This user must have enough permissions to run the bootstrap script +# Running containers as root is not recommended in production. Change this to another UID - e.g. 1000 to be more secure runAsUser: 0 -# Create custom service account for Superset. If create: true and name is not provided, superset.fullname will be used. # serviceAccountName: superset serviceAccount: + # -- Create custom service account for Superset. If create: true and name is not provided, `superset.fullname` will be used. create: false annotations: {} -# Install additional packages and do any other bootstrap configuration in this script +# -- Install additional packages and do any other bootstrap configuration in this script # For production clusters it's recommended to build own image with this step done in CI +# @default -- see `values.yaml` bootstrapScript: | #!/bin/bash rm -rf /var/lib/apt/lists/* && \ @@ -39,21 +40,19 @@ bootstrapScript: | redis==3.5.3 && \ if [ ! -f ~/bootstrap ]; then echo "Running Superset with uid {{ .Values.runAsUser }}" > ~/bootstrap; fi -## The name of the secret which we will use to generate a superset_config.py file -## Note: this secret must have the key superset_config.py in it and can include other files as well -## +# -- The name of the secret which we will use to generate a superset_config.py file +# Note: this secret must have the key superset_config.py in it and can include other files as well configFromSecret: '{{ template "superset.fullname" . }}-config' -## The name of the secret which we will use to populate env vars in deployed pods -## This can be useful for secret keys, etc. -## +# -- The name of the secret which we will use to populate env vars in deployed pods +# This can be useful for secret keys, etc. envFromSecret: '{{ template "superset.fullname" . }}-env' -## This can be a list of template strings +# -- This can be a list of templated strings envFromSecrets: [] -## Extra environment variables that will be passed into pods -## -extraEnv: {} +# -- Extra environment variables that will be passed into pods +extraEnv: + {} # Different gunicorn settings, refer to the gunicorn documentation # https://docs.gunicorn.org/en/stable/settings.html# # These variables are used as Flags at the gunicorn startup @@ -75,9 +74,9 @@ extraEnv: {} # # this includes any random Gmail address if your OAuth2 Web App is set to External. # OAUTH_WHITELIST_REGEX: ... -## Extra environment variables in RAW format that will be passed into pods -## -extraEnvRaw: [] +# -- Extra environment variables in RAW format that will be passed into pods +extraEnvRaw: + [] # Load DB password from other secret (e.g. for zalando operator) # - name: DB_PASS # valueFrom: @@ -85,15 +84,17 @@ extraEnvRaw: [] # name: superset.superset-postgres.credentials.postgresql.acid.zalan.do # key: password -## Extra environment variables to pass as secrets -## -extraSecretEnv: {} +# -- Extra environment variables to pass as secrets +extraSecretEnv: + {} # MAPBOX_API_KEY: ... # # Google API Keys: https://console.cloud.google.com/apis/credentials # GOOGLE_KEY: ... # GOOGLE_SECRET: ... -extraConfigs: {} +# -- Extra files to mount on `/app/pythonpath` +extraConfigs: + {} # import_datasources.yaml: | # databases: # - allow_file_upload: true @@ -106,27 +107,32 @@ extraConfigs: {} # sqlalchemy_uri: example://example-db.local # tables: [] +# -- Extra files to mount on `/app/pythonpath` as secrets extraSecrets: {} -extraVolumes: [] - # - name: customConfig - # configMap: - # name: '{{ template "superset.fullname" . }}-custom-config' - # - name: additionalSecret - # secret: - # secretName: my-secret - # defaultMode: 0600 - -extraVolumeMounts: [] - # - name: customConfig - # mountPath: /mnt/config - # readOnly: true - # - name: additionalSecret: - # mountPath: /mnt/secret - -# A dictionary of overrides to append at the end of superset_config.py - the name does not matter +extraVolumes: + [] + # - name: customConfig + # configMap: + # name: '{{ template "superset.fullname" . }}-custom-config' + # - name: additionalSecret + # secret: + # secretName: my-secret + # defaultMode: 0600 + +extraVolumeMounts: + [] + # - name: customConfig + # mountPath: /mnt/config + # readOnly: true + # - name: additionalSecret: + # mountPath: /mnt/secret + +# -- A dictionary of overrides to append at the end of superset_config.py - the name does not matter # WARNING: the order is not guaranteed -configOverrides: {} +# Files can be passed as helm --set-file configOverrides.my-override=my-file.py +configOverrides: + {} # extend_timeout: | # # Extend timeout to allow long running queries. # SUPERSET_WEBSERVER_TIMEOUT = ... @@ -162,12 +168,13 @@ configOverrides: {} # secret: | # # Generate your own secret key for encryption. Use openssl rand -base64 42 to generate a good key # SECRET_KEY = 'YOUR_OWN_RANDOM_GENERATED_SECRET_KEY' -# Same as above but the values are files -configOverridesFiles: {} + +# -- Same as above but the values are files +configOverridesFiles: + {} # extend_timeout: extend_timeout.py # enable_oauth: enable_oauth.py - configMountPath: "/app/pythonpath" extraConfigMountPath: "/app/configs" @@ -187,14 +194,16 @@ initImage: service: type: ClusterIP port: 8088 - annotations: {} + annotations: + {} # cloud.google.com/load-balancer-type: "Internal" loadBalancerIP: null ingress: enabled: false # ingressClassName: nginx - annotations: {} + annotations: + {} # kubernetes.io/tls-acme: "true" ## Extend timeout to allow long running queries. # nginx.ingress.kubernetes.io/proxy-connect-timeout: "300" @@ -209,7 +218,8 @@ ingress: # hosts: # - chart-example.local -resources: {} +resources: + {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little # resources, such as Minikube. If you do want to specify resources, uncomment the following @@ -223,25 +233,24 @@ resources: {} # cpu: 100m # memory: 128Mi -## -## Custom hostAliases for all superset pods +# -- Custom hostAliases for all superset pods ## https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/ hostAliases: [] # - hostnames: # - nodns.my.lan # ip: 18.27.36.45 - -## -## Superset node configuration +# Superset node configuration supersetNode: replicaCount: 1 + # -- Startup command + # @default -- See `values.yaml` command: - "/bin/sh" - "-c" - ". {{ .Values.configMountPath }}/superset_bootstrap.sh; /usr/bin/run-server.sh" connections: - # Change in case of bringing your own redis and then also set redis.enabled:false + # -- Change in case of bringing your own redis and then also set redis.enabled:false redis_host: '{{ template "superset.fullname" . }}-redis-headless' # redis_password: superset redis_port: "6379" @@ -252,35 +261,59 @@ supersetNode: db_pass: superset db_name: superset env: {} - forceReload: false # If true, forces deployment to reload on each upgrade + # -- If true, forces deployment to reload on each upgrade + forceReload: false + # -- Init containers + # @default -- a container waiting for postgres to be up initContainers: - name: wait-for-postgres image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" imagePullPolicy: "{{ .Values.initImage.pullPolicy }}" envFrom: - secretRef: - name: '{{ tpl .Values.envFromSecret . }}' - command: [ "/bin/sh", "-c", "until nc -zv $DB_HOST $DB_PORT -w1; do echo 'waiting for db'; sleep 1; done" ] - ## Annotations to be added to supersetNode deployment + name: "{{ tpl .Values.envFromSecret . }}" + command: + [ + "/bin/sh", + "-c", + "until nc -zv $DB_HOST $DB_PORT -w1; do echo 'waiting for db'; sleep 1; done", + ] + # -- Annotations to be added to supersetNode deployment deploymentAnnotations: {} - ## Annotations to be added to supersetNode pods + # -- Annotations to be added to supersetNode pods podAnnotations: {} - ## Labels to be added to supersetNode pods + # -- Labels to be added to supersetNode pods podLabels: {} + startupProbe: + httpGet: + path: /health + port: http + initialDelaySeconds: 15 + timeoutSeconds: 1 + failureThreshold: 60 + periodSeconds: 5 + successThreshold: 1 livenessProbe: + httpGet: + path: /health + port: http initialDelaySeconds: 15 timeoutSeconds: 1 failureThreshold: 3 periodSeconds: 15 successThreshold: 1 readinessProbe: + httpGet: + path: /health + port: http initialDelaySeconds: 15 timeoutSeconds: 1 failureThreshold: 3 periodSeconds: 15 successThreshold: 1 - # Resource settings for the supersetNode pods - these settings overwrite might existing values from the global resources object defined above. - resources: {} + # -- Resource settings for the supersetNode pods - these settings overwrite might existing values from the global resources object defined above. + resources: + {} # limits: # cpu: 100m # memory: 128Mi @@ -289,37 +322,48 @@ supersetNode: # memory: 128Mi podSecurityContext: {} containerSecurityContext: {} - strategy: {} + strategy: + {} # type: RollingUpdate # rollingUpdate: # maxSurge: 25% # maxUnavailable: 25% -## -## Superset worker configuration +# Superset Celery worker configuration supersetWorker: replicaCount: 1 + # -- Worker startup command + # @default -- a `celery worker` command command: - "/bin/sh" - "-c" - ". {{ .Values.configMountPath }}/superset_bootstrap.sh; celery --app=superset.tasks.celery_app:app worker" - forceReload: false # If true, forces deployment to reload on each upgrade + # -- If true, forces deployment to reload on each upgrade + forceReload: false + # -- Init container + # @default -- a container waiting for postgres initContainers: - name: wait-for-postgres image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" imagePullPolicy: "{{ .Values.initImage.pullPolicy }}" envFrom: - secretRef: - name: '{{ tpl .Values.envFromSecret . }}' - command: [ "/bin/sh", "-c", "until nc -zv $DB_HOST $DB_PORT -w1; do echo 'waiting for db'; sleep 1; done" ] - ## Annotations to be added to supersetWorker deployment + name: "{{ tpl .Values.envFromSecret . }}" + command: + [ + "/bin/sh", + "-c", + "until nc -zv $DB_HOST $DB_PORT -w1; do echo 'waiting for db'; sleep 1; done", + ] + # -- Annotations to be added to supersetWorker deployment deploymentAnnotations: {} - ## Annotations to be added to supersetWorker pods + # -- Annotations to be added to supersetWorker pods podAnnotations: {} - ## Labels to be added to supersetWorker pods + # -- Labels to be added to supersetWorker pods podLabels: {} - # Resource settings for the supersetWorker pods - these settings overwrite might existing values from the global resources object defined above. - resources: {} + # -- Resource settings for the supersetWorker pods - these settings overwrite might existing values from the global resources object defined above. + resources: + {} # limits: # cpu: 100m # memory: 128Mi @@ -328,38 +372,108 @@ supersetWorker: # memory: 128Mi podSecurityContext: {} containerSecurityContext: {} - strategy: {} + strategy: + {} # type: RollingUpdate # rollingUpdate: # maxSurge: 25% # maxUnavailable: 25% + livenessProbe: + exec: + # -- Liveness probe command + # @default -- a `celery inspect ping` command + command: + - sh + - -c + - celery inspect ping -A superset.tasks.celery_app:app -d celery@$HOSTNAME + initialDelaySeconds: 120 + timeoutSeconds: 60 + failureThreshold: 3 + periodSeconds: 60 + successThreshold: 1 + # -- No startup/readiness probes by default since we don't really care about its startup time (it doesn't serve traffic) + startupProbe: {} + # -- No startup/readiness probes by default since we don't really care about its startup time (it doesn't serve traffic) + readinessProbe: {} -## -## Superset beat configuration (to trigger scheduled jobs like reports) +# Superset beat configuration (to trigger scheduled jobs like reports) supersetCeleryBeat: - # This is only required if you intend to use alerts and reports + # -- This is only required if you intend to use alerts and reports enabled: false + # -- Command + # @default -- a port wait command command: - "/bin/sh" - "-c" - ". {{ .Values.configMountPath }}/superset_bootstrap.sh; celery --app=superset.tasks.celery_app:app beat --pidfile /tmp/celerybeat.pid --schedule /tmp/celerybeat-schedule" - forceReload: false # If true, forces deployment to reload on each upgrade + # -- If true, forces deployment to reload on each upgrade + forceReload: false + flower: + # -- If true, will expose a web-based UI to monitor jobs + # WARNING: requires a Superset image that has `flower<1.0.0` installed (which is NOT the case of the default images) + # flower>=1.0.0 requires Celery 5+ which Superset does not support + enabled: false + # -- Command + # @default -- a `celery flower` command + command: + - "/bin/sh" + - "-c" + - ". {{ .Values.configMountPath }}/superset_bootstrap.sh; celery --app=superset.tasks.celery_app:app flower" + service: + type: ClusterIP + annotations: {} + port: 5555 + startupProbe: + httpGet: + path: /api/workers + port: flower + initialDelaySeconds: 5 + timeoutSeconds: 1 + failureThreshold: 60 + periodSeconds: 5 + successThreshold: 1 + livenessProbe: + httpGet: + path: /api/workers + port: flower + initialDelaySeconds: 5 + timeoutSeconds: 1 + failureThreshold: 3 + periodSeconds: 5 + successThreshold: 1 + readinessProbe: + httpGet: + path: /api/workers + port: flower + initialDelaySeconds: 5 + timeoutSeconds: 1 + failureThreshold: 3 + periodSeconds: 5 + successThreshold: 1 + # -- List of init containers + # @default -- a container waiting for postgres initContainers: - name: wait-for-postgres image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" imagePullPolicy: "{{ .Values.initImage.pullPolicy }}" envFrom: - secretRef: - name: '{{ tpl .Values.envFromSecret . }}' - command: [ "/bin/sh", "-c", "until nc -zv $DB_HOST $DB_PORT -w1; do echo 'waiting for db'; sleep 1; done" ] - ## Annotations to be added to supersetCeleryBeat deployment + name: "{{ tpl .Values.envFromSecret . }}" + command: + [ + "/bin/sh", + "-c", + "until nc -zv $DB_HOST $DB_PORT -w1; do echo 'waiting for db'; sleep 1; done", + ] + # -- Annotations to be added to supersetCeleryBeat deployment deploymentAnnotations: {} - ## Annotations to be added to supersetCeleryBeat pods + # -- Annotations to be added to supersetCeleryBeat pods podAnnotations: {} - ## Labels to be added to supersetCeleryBeat pods + # -- Labels to be added to supersetCeleryBeat pods podLabels: {} - # Resource settings for the CeleryBeat pods - these settings overwrite might existing values from the global resources object defined above. - resources: {} + # -- Resource settings for the CeleryBeat pods - these settings overwrite might existing values from the global resources object defined above. + resources: + {} # limits: # cpu: 100m # memory: 128Mi @@ -368,21 +482,98 @@ supersetCeleryBeat: # memory: 128Mi podSecurityContext: {} containerSecurityContext: {} -## -## Init job configuration + +supersetWebsockets: + # -- This is only required if you intend to use `GLOBAL_ASYNC_QUERIES` in `ws` mode + # see https://github.com/apache/superset/blob/master/CONTRIBUTING.md#async-chart-queries + enabled: false + replicaCount: 1 + ingress: + path: /ws + pathType: Prefix + image: + # -- There is no official image (yet), this one is community-supported + repository: immobisolusiprima/superset-websocket + tag: latest + pullPolicy: IfNotPresent + # -- The config.json to pass to the server, see https://github.com/apache/superset/tree/master/superset-websocket + # Note that the configuration can also read from environment variables (which will have priority), see https://github.com/apache/superset/blob/master/superset-websocket/src/config.ts for a list of supported variables + # @default -- see `values.yaml` + config: + { + "port": 8080, + "logLevel": "debug", + "logToFile": false, + "logFilename": "app.log", + "statsd": { "host": "127.0.0.1", "port": 8125, "globalTags": [] }, + "redis": + { + "port": 6379, + "host": "127.0.0.1", + "password": "", + "db": 0, + "ssl": false, + }, + "redisStreamPrefix": "async-events-", + "jwtSecret": "CHANGE-ME", + "jwtCookieName": "async-token", + } + service: + type: ClusterIP + annotations: {} + port: 8080 + command: [] + resources: {} + deploymentAnnotations: {} + podAnnotations: {} + podLabels: {} + strategy: {} + podSecurityContext: {} + containerSecurityContext: {} + startupProbe: + httpGet: + path: /health + port: ws + initialDelaySeconds: 5 + timeoutSeconds: 1 + failureThreshold: 60 + periodSeconds: 5 + successThreshold: 1 + livenessProbe: + httpGet: + path: /health + port: ws + initialDelaySeconds: 5 + timeoutSeconds: 1 + failureThreshold: 3 + periodSeconds: 5 + successThreshold: 1 + readinessProbe: + httpGet: + path: /health + port: ws + initialDelaySeconds: 5 + timeoutSeconds: 1 + failureThreshold: 3 + periodSeconds: 5 + successThreshold: 1 + init: # Configure resources # Warning: fab command consumes a lot of ram and can # cause the process to be killed due to OOM if it exceeds limit # Make sure you are giving a strong password for the admin user creation( else make sure you are changing after setup) # Also change the admin email to your own custom email. - resources: {} + resources: + {} # limits: # cpu: # memory: # requests: # cpu: # memory: + # -- Command + # @default -- a `superset_init.sh` command command: - "/bin/sh" - "-c" @@ -396,14 +587,23 @@ init: lastname: Admin email: admin@superset.com password: admin + # -- List of initContainers + # @default -- a container waiting for postgres initContainers: - name: wait-for-postgres image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" imagePullPolicy: "{{ .Values.initImage.pullPolicy }}" envFrom: - secretRef: - name: '{{ tpl .Values.envFromSecret . }}' - command: [ "/bin/sh", "-c", "until nc -zv $DB_HOST $DB_PORT -w1; do echo 'waiting for db'; sleep 1; done" ] + name: "{{ tpl .Values.envFromSecret . }}" + command: + [ + "/bin/sh", + "-c", + "until nc -zv $DB_HOST $DB_PORT -w1; do echo 'waiting for db'; sleep 1; done", + ] + # -- A Superset init script + # @default -- a script to create admin user and initailize roles initscript: |- #!/bin/sh set -eu @@ -433,9 +633,10 @@ init: podAnnotations: {} podSecurityContext: {} containerSecurityContext: {} -## -## Configuration values for the postgresql dependency. -## ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md + +# -- Configuration values for the postgresql dependency. +# ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md +# @default -- see `values.yaml` postgresql: ## ## Use the PostgreSQL chart dependency. @@ -453,7 +654,6 @@ postgresql: ## PostgreSQL name for a custom database to create database: superset - ## PostgreSQL Primary parameters primary: ## @@ -475,9 +675,10 @@ postgresql: ports: postgresql: "5432" -## Configuration values for the Redis dependency. -## ref: https://github.com/bitnami/charts/blob/master/bitnami/redis -## More documentation can be found here: https://artifacthub.io/packages/helm/bitnami/redis +# -- Configuration values for the Redis dependency. +# ref: https://github.com/bitnami/charts/blob/master/bitnami/redis +# More documentation can be found here: https://artifacthub.io/packages/helm/bitnami/redis +# @default -- see `values.yaml` redis: ## ## Use the redis chart dependency. @@ -508,9 +709,9 @@ redis: ## ## Image configuration # image: - ## - ## docker registry secret names (list) - # pullSecrets: nil + ## + ## docker registry secret names (list) + # pullSecrets: nil ## ## Configure persistance persistence: @@ -523,7 +724,7 @@ redis: ## ## Access mode: accessModes: - - ReadWriteOnce + - ReadWriteOnce nodeSelector: {} From 29c9d66c58b183c193fc590b86415ce7cab6752b Mon Sep 17 00:00:00 2001 From: Yann Jouanique Date: Thu, 13 Oct 2022 22:38:57 +0200 Subject: [PATCH 02/12] Polish readme --- helm/superset/Chart.yaml | 1 - helm/superset/README.md | 8 +++++++- helm/superset/values.yaml | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/helm/superset/Chart.yaml b/helm/superset/Chart.yaml index 41b3546666360..2b00677ea1b79 100644 --- a/helm/superset/Chart.yaml +++ b/helm/superset/Chart.yaml @@ -19,7 +19,6 @@ appVersion: "1.0" description: Apache Superset is a modern, enterprise-ready business intelligence web application name: superset home: https://superset.apache.org/ -icon: https://avatars.githubusercontent.com/u/5543677?s=400&v=4 keywords: - business intelligence - data science diff --git a/helm/superset/README.md b/helm/superset/README.md index 6c8754454b491..688528278d5d5 100644 --- a/helm/superset/README.md +++ b/helm/superset/README.md @@ -4,6 +4,12 @@ Apache Superset is a modern, enterprise-ready business intelligence web application +**Homepage:** + +## Source Code + +* + ## TL;DR; ```console @@ -160,7 +166,7 @@ helm install my-superset superset/superset | supersetWebsockets.deploymentAnnotations | object | `{}` | | | supersetWebsockets.enabled | bool | `false` | This is only required if you intend to use `GLOBAL_ASYNC_QUERIES` in `ws` mode see https://github.com/apache/superset/blob/master/CONTRIBUTING.md#async-chart-queries | | supersetWebsockets.image.pullPolicy | string | `"IfNotPresent"` | | -| supersetWebsockets.image.repository | string | `"immobisolusiprima/superset-websocket"` | There is no official image (yet), this one is community-supported | +| 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"` | | diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml index 617893fb849e1..24b6e410ad60a 100644 --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -19,6 +19,9 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. +# A README is automatically generated from this file to document it, using helm-docs (see https://github.com/norwoodj/helm-docs) +# To update it, install helm-docs and run helm-docs from the root of this chart + # -- User ID directive. This user must have enough permissions to run the bootstrap script # Running containers as root is not recommended in production. Change this to another UID - e.g. 1000 to be more secure runAsUser: 0 @@ -493,7 +496,7 @@ supersetWebsockets: pathType: Prefix image: # -- There is no official image (yet), this one is community-supported - repository: immobisolusiprima/superset-websocket + repository: oneacrefund/superset-websocket tag: latest pullPolicy: IfNotPresent # -- The config.json to pass to the server, see https://github.com/apache/superset/tree/master/superset-websocket From 91d790d4594b5ee3bf0b96485db858844435beba Mon Sep 17 00:00:00 2001 From: Yann Jouanique Date: Thu, 13 Oct 2022 23:56:50 +0200 Subject: [PATCH 03/12] Switch to nindent --- helm/superset/templates/deployment-beat.yaml | 14 +++++++------- helm/superset/templates/deployment-worker.yaml | 12 ++++++------ helm/superset/templates/deployment-ws.yaml | 12 ++++++------ helm/superset/templates/deployment.yaml | 12 ++++++------ helm/superset/templates/ingress.yaml | 6 +++--- helm/superset/templates/init-job.yaml | 12 ++++++------ 6 files changed, 34 insertions(+), 34 deletions(-) diff --git a/helm/superset/templates/deployment-beat.yaml b/helm/superset/templates/deployment-beat.yaml index 2b1161c0d8469..a5bf73457ef11 100644 --- a/helm/superset/templates/deployment-beat.yaml +++ b/helm/superset/templates/deployment-beat.yaml @@ -26,7 +26,7 @@ metadata: heritage: {{ .Release.Service }} {{- if .Values.supersetCeleryBeat.deploymentAnnotations }} annotations: - {{ toYaml .Values.supersetCeleryBeat.deploymentAnnotations | nindent 4 }} + {{- toYaml .Values.supersetCeleryBeat.deploymentAnnotations | nindent 4 }} {{- end }} spec: # This must be a singleton @@ -50,13 +50,13 @@ spec: force-reload: {{ randAlphaNum 5 | quote }} {{ end }} {{- if .Values.supersetCeleryBeat.podAnnotations }} - {{ toYaml .Values.supersetCeleryBeat.podAnnotations | nindent 8 }} + {{- toYaml .Values.supersetCeleryBeat.podAnnotations | nindent 8 }} {{- end }} labels: app: "{{ template "superset.name" . }}-celerybeat" release: {{ .Release.Name }} {{- if .Values.supersetCeleryBeat.podLabels }} - {{ toYaml .Values.supersetCeleryBeat.podLabels | nindent 8 }} + {{- toYaml .Values.supersetCeleryBeat.podLabels | nindent 8 }} {{- end }} spec: {{- if or (.Values.serviceAccount.create) (.Values.serviceAccountName) }} @@ -65,21 +65,21 @@ spec: securityContext: runAsUser: {{ .Values.runAsUser }} {{- if .Values.supersetCeleryBeat.podSecurityContext }} - {{ toYaml .Values.supersetCeleryBeat.podSecurityContext | nindent 8 }} + {{- toYaml .Values.supersetCeleryBeat.podSecurityContext | nindent 8 }} {{- end }} {{- if .Values.supersetCeleryBeat.initContainers }} initContainers: {{- tpl (toYaml .Values.supersetCeleryBeat.initContainers) . | nindent 6 }} {{- end }} {{- with .Values.hostAliases }} - hostAliases: {{ toYaml . | nindent 6 }} + hostAliases: {{- toYaml . | nindent 6 }} {{- end }} containers: - name: "{{ .Chart.Name }}-celerybeat" image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.supersetCeleryBeat.containerSecurityContext }} - securityContext: {{ toYaml .Values.supersetCeleryBeat.containerSecurityContext | nindent 12 }} + securityContext: {{- toYaml .Values.supersetCeleryBeat.containerSecurityContext | nindent 12 }} {{- end }} command: {{ tpl (toJson .Values.supersetCeleryBeat.command) . }} env: @@ -117,7 +117,7 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.supersetCeleryBeat.containerSecurityContext }} - securityContext: {{ toYaml .Values.supersetCeleryBeat.containerSecurityContext | nindent 12 }} + securityContext: {{- toYaml .Values.supersetCeleryBeat.containerSecurityContext | nindent 12 }} {{- end }} command: {{ tpl (toJson .Values.supersetCeleryBeat.flower.command) . }} env: diff --git a/helm/superset/templates/deployment-worker.yaml b/helm/superset/templates/deployment-worker.yaml index f11cba46904af..c2e924438e7c0 100644 --- a/helm/superset/templates/deployment-worker.yaml +++ b/helm/superset/templates/deployment-worker.yaml @@ -25,7 +25,7 @@ metadata: heritage: {{ .Release.Service }} {{- if .Values.supersetWorker.deploymentAnnotations }} annotations: - {{ toYaml .Values.supersetWorker.deploymentAnnotations | nindent 4 }} + {{- toYaml .Values.supersetWorker.deploymentAnnotations | nindent 4 }} {{- end }} spec: replicas: {{ .Values.supersetWorker.replicaCount }} @@ -52,13 +52,13 @@ spec: force-reload: {{ randAlphaNum 5 | quote }} {{ end }} {{- if .Values.supersetWorker.podAnnotations }} - {{ toYaml .Values.supersetWorker.podAnnotations | nindent 8 }} + {{- toYaml .Values.supersetWorker.podAnnotations | nindent 8 }} {{- end }} labels: app: {{ template "superset.name" . }}-worker release: {{ .Release.Name }} {{- if .Values.supersetWorker.podLabels }} - {{ toYaml .Values.supersetWorker.podLabels | nindent 8 }} + {{- toYaml .Values.supersetWorker.podLabels | nindent 8 }} {{- end }} spec: {{- if or (.Values.serviceAccount.create) (.Values.serviceAccountName) }} @@ -67,21 +67,21 @@ spec: securityContext: runAsUser: {{ .Values.runAsUser }} {{- if .Values.supersetWorker.podSecurityContext }} - {{ toYaml .Values.supersetWorker.podSecurityContext | nindent 8 }} + {{- toYaml .Values.supersetWorker.podSecurityContext | nindent 8 }} {{- end }} {{- if .Values.supersetWorker.initContainers }} initContainers: {{- tpl (toYaml .Values.supersetWorker.initContainers) . | nindent 6 }} {{- end }} {{- with .Values.hostAliases }} - hostAliases: {{ toYaml . | nindent 6 }} + hostAliases: {{- toYaml . | nindent 6 }} {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.supersetWorker.containerSecurityContext }} - securityContext: {{ toYaml .Values.supersetWorker.containerSecurityContext | nindent 12 }} + securityContext: {{- toYaml .Values.supersetWorker.containerSecurityContext | nindent 12 }} {{- end }} command: {{ tpl (toJson .Values.supersetWorker.command) . }} env: diff --git a/helm/superset/templates/deployment-ws.yaml b/helm/superset/templates/deployment-ws.yaml index 5ae5b26943a66..e550bccb29b13 100644 --- a/helm/superset/templates/deployment-ws.yaml +++ b/helm/superset/templates/deployment-ws.yaml @@ -26,7 +26,7 @@ metadata: heritage: {{ .Release.Service }} {{- if .Values.supersetWebsockets.deploymentAnnotations }} annotations: - {{ toYaml .Values.supersetWebsockets.deploymentAnnotations | nindent 4 }} + {{- toYaml .Values.supersetWebsockets.deploymentAnnotations | nindent 4 }} {{- end }} spec: replicas: {{ .Values.supersetWebsockets.replicaCount }} @@ -43,13 +43,13 @@ spec: annotations: checksum/wsconfig: {{ tpl (toJson .Values.supersetWebsockets.config) . | sha256sum }} {{- if .Values.supersetWebsockets.podAnnotations }} - {{ toYaml .Values.supersetWebsockets.podAnnotations | nindent 8 }} + {{- toYaml .Values.supersetWebsockets.podAnnotations | nindent 8 }} {{- end }} labels: app: "{{ template "superset.name" . }}-ws" release: {{ .Release.Name }} {{- if .Values.supersetWebsockets.podLabels }} - {{ toYaml .Values.supersetWebsockets.podLabels | nindent 8 }} + {{- toYaml .Values.supersetWebsockets.podLabels | nindent 8 }} {{- end }} spec: {{- if or (.Values.serviceAccount.create) (.Values.serviceAccountName) }} @@ -58,17 +58,17 @@ spec: securityContext: runAsUser: {{ .Values.runAsUser }} {{- if .Values.supersetWebsockets.podSecurityContext }} - {{ toYaml .Values.supersetWebsockets.podSecurityContext | nindent 8 }} + {{- toYaml .Values.supersetWebsockets.podSecurityContext | nindent 8 }} {{- end }} {{- with .Values.hostAliases }} - hostAliases: {{ toYaml . | nindent 6 }} + hostAliases: {{- toYaml . | nindent 6 }} {{- end }} containers: - name: "{{ .Chart.Name }}-ws" image: "{{ .Values.supersetWebsockets.image.repository }}:{{ .Values.supersetWebsockets.image.tag }}" imagePullPolicy: {{ .Values.supersetWebsockets.image.pullPolicy }} {{- if .Values.supersetWebsockets.containerSecurityContext }} - securityContext: {{ toYaml .Values.supersetWebsockets.containerSecurityContext | nindent 12 }} + securityContext: {{- toYaml .Values.supersetWebsockets.containerSecurityContext | nindent 12 }} {{- end }} command: {{ tpl (toJson .Values.supersetWebsockets.command) . }} # Passing all the envs is a bit blunt... we only need a few (see https://github.com/apache/superset/blob/master/superset-websocket/src/config.ts)... diff --git a/helm/superset/templates/deployment.yaml b/helm/superset/templates/deployment.yaml index b9ef2052e1708..a02c9cf293dcf 100644 --- a/helm/superset/templates/deployment.yaml +++ b/helm/superset/templates/deployment.yaml @@ -25,7 +25,7 @@ metadata: heritage: {{ .Release.Service }} {{- if .Values.supersetNode.deploymentAnnotations }} annotations: - {{ toYaml .Values.supersetNode.deploymentAnnotations | nindent 4 }} + {{- toYaml .Values.supersetNode.deploymentAnnotations | nindent 4 }} {{- end }} spec: replicas: {{ .Values.supersetNode.replicaCount }} @@ -55,13 +55,13 @@ spec: force-reload: {{ randAlphaNum 5 | quote }} {{- end }} {{- if .Values.supersetNode.podAnnotations }} - {{ toYaml .Values.supersetNode.podAnnotations | nindent 8 }} + {{- toYaml .Values.supersetNode.podAnnotations | nindent 8 }} {{- end }} labels: app: {{ template "superset.name" . }} release: {{ .Release.Name }} {{- if .Values.supersetNode.podLabels }} - {{ toYaml .Values.supersetNode.podLabels | nindent 8 }} + {{- toYaml .Values.supersetNode.podLabels | nindent 8 }} {{- end }} spec: {{- if or (.Values.serviceAccount.create) (.Values.serviceAccountName) }} @@ -70,21 +70,21 @@ spec: securityContext: runAsUser: {{ .Values.runAsUser }} {{- if .Values.supersetNode.podSecurityContext }} - {{ toYaml .Values.supersetNode.podSecurityContext | nindent 8 }} + {{- toYaml .Values.supersetNode.podSecurityContext | nindent 8 }} {{- end }} {{- if .Values.supersetNode.initContainers }} initContainers: {{- tpl (toYaml .Values.supersetNode.initContainers) . | nindent 6 }} {{- end }} {{- with .Values.hostAliases }} - hostAliases: {{ toYaml . | nindent 6 }} + hostAliases: {{- toYaml . | nindent 6 }} {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.supersetNode.containerSecurityContext }} - securityContext: {{ toYaml .Values.supersetNode.containerSecurityContext | nindent 12 }} + securityContext: {{- toYaml .Values.supersetNode.containerSecurityContext | nindent 12 }} {{- end }} command: {{ tpl (toJson .Values.supersetNode.command) . }} env: diff --git a/helm/superset/templates/ingress.yaml b/helm/superset/templates/ingress.yaml index e003b8153f2a7..c0df1e90e6f7f 100644 --- a/helm/superset/templates/ingress.yaml +++ b/helm/superset/templates/ingress.yaml @@ -25,10 +25,10 @@ metadata: chart: {{ template "superset.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} -{{- with .Values.ingress.annotations }} + {{- with .Values.ingress.annotations }} annotations: -{{ toYaml . | indent 4 }} -{{- end }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- if .Values.ingress.ingressClassName }} ingressClassName: {{ .Values.ingress.ingressClassName }} diff --git a/helm/superset/templates/init-job.yaml b/helm/superset/templates/init-job.yaml index 92b8ce745dfff..878e93095853b 100644 --- a/helm/superset/templates/init-job.yaml +++ b/helm/superset/templates/init-job.yaml @@ -28,7 +28,7 @@ spec: name: {{ template "superset.name" . }}-init-db {{- if .Values.init.podAnnotations }} annotations: - {{ toYaml .Values.init.podAnnotations | nindent 8 }} + {{- toYaml .Values.init.podAnnotations | nindent 8 }} {{- end }} spec: {{- if or (.Values.serviceAccount.create) (.Values.serviceAccountName) }} @@ -37,7 +37,7 @@ spec: securityContext: runAsUser: {{ .Values.runAsUser }} {{- if .Values.init.podSecurityContext }} - {{ toYaml .Values.init.podSecurityContext | nindent 8 }} + {{- toYaml .Values.init.podSecurityContext | nindent 8 }} {{- end }} {{- if .Values.init.initContainers }} initContainers: @@ -65,7 +65,7 @@ spec: {{- end }} imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.init.containerSecurityContext }} - securityContext: {{ toYaml .Values.init.containerSecurityContext | nindent 12 }} + securityContext: {{- toYaml .Values.init.containerSecurityContext | nindent 12 }} {{- end }} volumeMounts: - name: superset-config @@ -81,10 +81,10 @@ spec: {{- end }} command: {{ tpl (toJson .Values.init.command) . }} resources: -{{ toYaml .Values.init.resources | indent 10 }} -{{- if .Values.imagePullSecrets }} + {{- toYaml .Values.init.resources | nindent 10 }} + {{- if .Values.imagePullSecrets }} imagePullSecrets: -{{ toYaml .Values.imagePullSecrets | indent 8 }} + {{- toYaml .Values.imagePullSecrets | nindent 8 }} {{- end }} volumes: - name: superset-config From f0fbc6e92438a88e83fc5b2574880f906906dde1 Mon Sep 17 00:00:00 2001 From: Yann Jouanique Date: Thu, 13 Oct 2022 23:58:58 +0200 Subject: [PATCH 04/12] Remove schema --- helm/superset/toto.json | 700 ---------------------------------------- 1 file changed, 700 deletions(-) delete mode 100644 helm/superset/toto.json diff --git a/helm/superset/toto.json b/helm/superset/toto.json deleted file mode 100644 index 40edb991ddd88..0000000000000 --- a/helm/superset/toto.json +++ /dev/null @@ -1,700 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "additionalProperties": true, - "properties": { - "runAsUser": { - "type": "integer" - }, - "serviceAccount": { - "type": "object", - "additionalProperties": false, - "properties": { - "create": { - "type": "boolean" - }, - "annotations": { - "type": "object" - } - }, - "required": [ - "create" - ] - }, - "bootstrapScript": { - "type": "string" - }, - "configFromSecret": { - "type": "string" - }, - "envFromSecret": { - "type": "string" - }, - "envFromSecrets": { - "type": "array" - }, - "extraEnv": { - "type": "object" - }, - "extraEnvRaw": { - "type": "array" - }, - "extraSecretEnv": { - "type": "object" - }, - "extraConfigs": { - "type": "object" - }, - "extraSecrets": { - "type": "object" - }, - "extraVolumes": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.apps.v1.PodSpec/properties/volumes" - }, - "extraVolumeMounts": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.apps.v1.PodSpec/properties/volumeMounts" - }, - "configOverrides": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "properties": { - "extend_timeout": { - "type": "string" - }, - "enable_oauth": { - "type": "string" - } - } - }, - "configOverridesFiles": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "properties": { - "extend_timeout": { - "type": "string" - }, - "enable_oauth": { - "type": "string" - } - } - }, - "configMountPath": { - "type": "string" - }, - "extraConfigMountPath": { - "type": "string" - }, - "image": { - "type": "object", - "additionalProperties": false, - "properties": { - "repository": { - "type": "string" - }, - "tag": { - "type": "string" - }, - "pullPolicy": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.core.v1.Container/properties/imagePullPolicy" - } - }, - "required": [ - "repository", - "tag", - "pullPolicy" - ] - }, - "imagePullSecrets": { - "type": "array" - }, - "initImage": { - "type": "object", - "additionalProperties": false, - "properties": { - "repository": { - "type": "string" - }, - "tag": { - "type": "string" - }, - "pullPolicy": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.core.v1.Container/properties/imagePullPolicy" - } - }, - "required": [ - "repository", - "tag", - "pullPolicy" - ] - }, - "service": { - "type": "object", - "additionalProperties": false, - "properties": { - "type": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.core.v1.ServiceSpec/properties/type" - }, - "port": { - "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" - }, - "loadBalancerIP": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.core.v1.ServiceSpec/properties/loadBalancerIP" - } - }, - "required": [ - "type", - "port" - ] - }, - "ingress": { - "type": "object", - "additionalProperties": false, - "properties": { - "enabled": { - "type": "boolean" - }, - "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" - }, - "path": { - "type": "string" - }, - "pathType": { - "type": "string" - }, - "ingressClassName": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.networking.v1.IngressSpec/properties/ingressClassName" - }, - "hosts": { - "type": "array", - "items": { - "type": "string" - } - }, - "tls": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "secretName": { - "type": "string" - }, - "hosts": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - }, - "required": [ - "enabled", - "annotations", - "path", - "pathType", - "hosts", - "tls" - ] - }, - "resources": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.core.v1.Container/properties/resources" - }, - "hostAliases": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.core.v1.PodSpec/properties/hostAliases" - }, - "supersetNode": { - "type": "object", - "additionalProperties": false, - "properties": { - "replicaCount": { - "type": "integer" - }, - "command": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.core.v1.Container/properties/command" - }, - "connections": { - "type": "object", - "additionalProperties": false, - "properties": { - "redis_host": { - "type": "string" - }, - "redis_password": { - "type": "string" - }, - "redis_port": { - "type": "string" - }, - "db_host": { - "type": "string" - }, - "db_port": { - "type": "string" - }, - "db_user": { - "type": "string" - }, - "db_pass": { - "type": "string" - }, - "db_name": { - "type": "string" - } - }, - "required": [ - "redis_host", - "redis_port", - "db_host", - "db_port", - "db_user", - "db_pass", - "db_name" - ] - }, - "env": { - "type": "object" - }, - "forceReload": { - "type": "boolean" - }, - "initContainers": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.core.v1.PodSpec/properties/initContainers" - }, - "deploymentAnnotations": { - "$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" - }, - "podAnnotations": { - "$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" - }, - "podLabels": { - "$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/labels" - }, - "livenessProbe": { - "type": "object", - "additionalProperties": false, - "properties": { - "initialDelaySeconds": { - "type": "integer" - }, - "timeoutSeconds": { - "type": "integer" - }, - "failureThreshold": { - "type": "integer" - }, - "periodSeconds": { - "type": "integer" - }, - "successThreshold": { - "type": "integer" - } - }, - "required": [ - "initialDelaySeconds", - "timeoutSeconds", - "failureThreshold", - "periodSeconds", - "successThreshold" - ] - }, - "readinessProbe": { - "type": "object", - "additionalProperties": false, - "properties": { - "initialDelaySeconds": { - "type": "integer" - }, - "timeoutSeconds": { - "type": "integer" - }, - "failureThreshold": { - "type": "integer" - }, - "periodSeconds": { - "type": "integer" - }, - "successThreshold": { - "type": "integer" - } - }, - "required": [ - "initialDelaySeconds", - "timeoutSeconds", - "failureThreshold", - "periodSeconds", - "successThreshold" - ] - }, - "resources": { - "type": "object" - }, - "podSecurityContext": { - "type": "object" - }, - "containerSecurityContext": { - "type": "object" - }, - "strategy": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.apps.v1.DeploymentStrategy" - } - }, - "required": [ - "replicaCount", - "command", - "connections", - "env", - "forceReload" - ] - }, - "supersetWorker": { - "type": "object", - "additionalProperties": false, - "properties": { - "replicaCount": { - "type": "integer" - }, - "command": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.core.v1.Container/properties/command" - }, - "forceReload": { - "type": "boolean" - }, - "initContainers": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.core.v1.PodSpec/properties/initContainers" - }, - "deploymentAnnotations": { - "$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" - }, - "podAnnotations": { - "$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" - }, - "podLabels": { - "$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/labels" - }, - "resources": { - "type": "object" - }, - "podSecurityContext": { - "type": "object" - }, - "containerSecurityContext": { - "type": "object" - }, - "strategy": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.apps.v1.DeploymentStrategy" - } - }, - "required": [ - "replicaCount", - "command", - "forceReload" - ] - }, - "supersetCeleryBeat": { - "type": "object", - "additionalProperties": false, - "properties": { - "enabled": { - "type": "boolean" - }, - "command": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.core.v1.Container/properties/command" - }, - "forceReload": { - "type": "boolean" - }, - "initContainers": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.core.v1.PodSpec/properties/initContainers" - }, - "deploymentAnnotations": { - "$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" - }, - "podAnnotations": { - "$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" - }, - "podLabels": { - "$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/labels" - }, - "resources": { - "type": "object" - }, - "podSecurityContext": { - "type": "object" - }, - "containerSecurityContext": { - "type": "object" - } - }, - "required": [ - "enabled", - "command", - "forceReload" - ] - }, - "init": { - "type": "object", - "additionalProperties": false, - "properties": { - "resources": { - "type": "object" - }, - "command": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.core.v1.Container/properties/command" - }, - "enabled": { - "type": "boolean" - }, - "loadExamples": { - "type": "boolean" - }, - "createAdmin": { - "type": "boolean" - }, - "adminUser": { - "type": "object", - "additionalProperties": false, - "properties": { - "username": { - "type": "string" - }, - "firstname": { - "type": "string" - }, - "lastname": { - "type": "string" - }, - "email": { - "type": "string" - }, - "password": { - "type": "string" - } - }, - "required": [ - "username", - "firstname", - "lastname", - "email", - "password" - ] - }, - "initContainers": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.core.v1.PodSpec/properties/initContainers" - }, - "initscript": { - "type": "string" - }, - "podAnnotations": { - "$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" - }, - "podSecurityContext": { - "type": "object" - }, - "containerSecurityContext": { - "type": "object" - } - }, - "required": [ - "resources", - "command", - "enabled", - "loadExamples", - "createAdmin", - "adminUser", - "initscript" - ] - }, - "postgresql": { - "type": "object", - "properties": { - "auth": { - "type": "object", - "properties": { - "database": { - "type": "string" - }, - "existingSecret": { - "type": [ - "string", - "null" - ] - }, - "password": { - "type": "string" - }, - "username": { - "type": "string" - } - } - }, - "enabled": { - "type": "boolean" - }, - "primary": { - "type": "object", - "properties": { - "persistence": { - "type": "object", - "properties": { - "accessModes": { - "type": "array", - "items": { - "type": "string" - } - }, - "enabled": { - "type": "boolean" - } - } - }, - "service": { - "type": "object", - "properties": { - "ports": { - "type": "object", - "properties": { - "postgresql": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "redis": { - "type": "object", - "additionalProperties": true, - "properties": { - "enabled": { - "type": "boolean" - }, - "architecture": { - "type": "string" - }, - "auth": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "existingSecret": { - "type": "string" - }, - "existingSecretKey": { - "type": "string" - }, - "password": { - "type": "string" - } - }, - "required": [ - "enabled" - ] - }, - "master": { - "type": "object", - "additionalProperties": true, - "properties": { - "persistence": { - "type": "object", - "additionalProperties": true, - "properties": { - "enabled": { - "type": "boolean" - }, - "accessModes": { - "type": "array", - "items": [ - { - "type": "string" - } - ] - } - }, - "required": [ - "enabled", - "accessModes" - ] - } - }, - "required": [ - "persistence" - ] - }, - "cluster": { - "type": "object", - "additionalProperties": true, - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ] - } - }, - "required": [ - "enabled", - "architecture", - "master" - ] - }, - "nodeSelector": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.apps.v1.PodSpec/properties/nodeSelector" - }, - "tolerations": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json##/definitions/io.k8s.api.apps.v1.PodSpec/properties/tolerations" - }, - "affinity": { - "$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.23.0/_definitions.json#/definitions/io.k8s.api.core.v1.Affinity" - } - }, - "required": [ - "runAsUser", - "serviceAccount", - "bootstrapScript", - "configFromSecret", - "envFromSecret", - "envFromSecrets", - "extraEnv", - "extraEnvRaw", - "extraSecretEnv", - "extraConfigs", - "extraSecrets", - "extraVolumes", - "extraVolumeMounts", - "configOverrides", - "configOverridesFiles", - "configMountPath", - "extraConfigMountPath", - "image", - "imagePullSecrets", - "service", - "ingress", - "resources", - "hostAliases", - "supersetNode", - "supersetWorker", - "supersetCeleryBeat", - "init", - "postgresql", - "redis", - "nodeSelector", - "tolerations", - "affinity" - ] -} From e8ba87e0fa0c89e11d4a0a7d23f61cb58714a143 Mon Sep 17 00:00:00 2001 From: Yann Jouanique Date: Sat, 15 Oct 2022 08:27:33 +0200 Subject: [PATCH 05/12] Moved flower to separate pod --- helm/superset/README.md | 66 ++++--- helm/superset/templates/deployment-beat.yaml | 53 ------ .../superset/templates/deployment-flower.yaml | 142 ++++++++++++++ helm/superset/templates/deployment-ws.yaml | 1 + helm/superset/templates/service.yaml | 18 +- helm/superset/values.yaml | 174 ++++++++++-------- 6 files changed, 288 insertions(+), 166 deletions(-) create mode 100644 helm/superset/templates/deployment-flower.yaml diff --git a/helm/superset/README.md b/helm/superset/README.md index 688528278d5d5..61509c4174af9 100644 --- a/helm/superset/README.md +++ b/helm/superset/README.md @@ -84,42 +84,50 @@ helm install my-superset superset/superset | service.type | string | `"ClusterIP"` | | | serviceAccount.annotations | object | `{}` | | | serviceAccount.create | bool | `false` | Create custom service account for Superset. If create: true and name is not provided, `superset.fullname` will be used. | -| supersetCeleryBeat.command | list | a port wait command | Command | +| supersetCeleryBeat.command | list | a `celery beat` command | Command | | supersetCeleryBeat.containerSecurityContext | object | `{}` | | | supersetCeleryBeat.deploymentAnnotations | object | `{}` | Annotations to be added to supersetCeleryBeat deployment | | supersetCeleryBeat.enabled | bool | `false` | This is only required if you intend to use alerts and reports | -| supersetCeleryBeat.flower.command | list | a `celery flower` command | Command | -| supersetCeleryBeat.flower.enabled | bool | `false` | If true, will expose a web-based UI to monitor jobs WARNING: requires a Superset image that has `flower<1.0.0` installed (which is NOT the case of the default images) flower>=1.0.0 requires Celery 5+ which Superset does not support | -| supersetCeleryBeat.flower.livenessProbe.failureThreshold | int | `3` | | -| supersetCeleryBeat.flower.livenessProbe.httpGet.path | string | `"/api/workers"` | | -| supersetCeleryBeat.flower.livenessProbe.httpGet.port | string | `"flower"` | | -| supersetCeleryBeat.flower.livenessProbe.initialDelaySeconds | int | `5` | | -| supersetCeleryBeat.flower.livenessProbe.periodSeconds | int | `5` | | -| supersetCeleryBeat.flower.livenessProbe.successThreshold | int | `1` | | -| supersetCeleryBeat.flower.livenessProbe.timeoutSeconds | int | `1` | | -| supersetCeleryBeat.flower.readinessProbe.failureThreshold | int | `3` | | -| supersetCeleryBeat.flower.readinessProbe.httpGet.path | string | `"/api/workers"` | | -| supersetCeleryBeat.flower.readinessProbe.httpGet.port | string | `"flower"` | | -| supersetCeleryBeat.flower.readinessProbe.initialDelaySeconds | int | `5` | | -| supersetCeleryBeat.flower.readinessProbe.periodSeconds | int | `5` | | -| supersetCeleryBeat.flower.readinessProbe.successThreshold | int | `1` | | -| supersetCeleryBeat.flower.readinessProbe.timeoutSeconds | int | `1` | | -| supersetCeleryBeat.flower.service.annotations | object | `{}` | | -| supersetCeleryBeat.flower.service.port | int | `5555` | | -| supersetCeleryBeat.flower.service.type | string | `"ClusterIP"` | | -| supersetCeleryBeat.flower.startupProbe.failureThreshold | int | `60` | | -| supersetCeleryBeat.flower.startupProbe.httpGet.path | string | `"/api/workers"` | | -| supersetCeleryBeat.flower.startupProbe.httpGet.port | string | `"flower"` | | -| supersetCeleryBeat.flower.startupProbe.initialDelaySeconds | int | `5` | | -| supersetCeleryBeat.flower.startupProbe.periodSeconds | int | `5` | | -| supersetCeleryBeat.flower.startupProbe.successThreshold | int | `1` | | -| supersetCeleryBeat.flower.startupProbe.timeoutSeconds | int | `1` | | | supersetCeleryBeat.forceReload | bool | `false` | If true, forces deployment to reload on each upgrade | | supersetCeleryBeat.initContainers | list | a container waiting for postgres | List of init containers | | supersetCeleryBeat.podAnnotations | object | `{}` | Annotations to be added to supersetCeleryBeat pods | | supersetCeleryBeat.podLabels | object | `{}` | Labels to be added to supersetCeleryBeat pods | | supersetCeleryBeat.podSecurityContext | object | `{}` | | | supersetCeleryBeat.resources | object | `{}` | Resource settings for the CeleryBeat pods - these settings overwrite might existing values from the global resources object defined above. | +| supersetCeleryFlower.command | list | a `celery flower` command | Command | +| supersetCeleryFlower.containerSecurityContext | object | `{}` | | +| supersetCeleryFlower.deploymentAnnotations | object | `{}` | Annotations to be added to supersetCeleryBeat deployment | +| supersetCeleryFlower.enabled | bool | `false` | Enables a Celery flower deployment (management UI to monitor celery jobs) WARNING: requires a Superset image that has `flower<1.0.0` installed (which is NOT the case of the default images) flower>=1.0.0 requires Celery 5+ which Superset does not support | +| supersetCeleryFlower.initContainers | list | a container waiting for postgres and redis | List of init containers | +| supersetCeleryFlower.livenessProbe.failureThreshold | int | `3` | | +| supersetCeleryFlower.livenessProbe.httpGet.path | string | `"/api/workers"` | | +| supersetCeleryFlower.livenessProbe.httpGet.port | string | `"flower"` | | +| supersetCeleryFlower.livenessProbe.initialDelaySeconds | int | `5` | | +| supersetCeleryFlower.livenessProbe.periodSeconds | int | `5` | | +| supersetCeleryFlower.livenessProbe.successThreshold | int | `1` | | +| supersetCeleryFlower.livenessProbe.timeoutSeconds | int | `1` | | +| supersetCeleryFlower.podAnnotations | object | `{}` | Annotations to be added to supersetCeleryBeat pods | +| supersetCeleryFlower.podLabels | object | `{}` | Labels to be added to supersetCeleryBeat pods | +| supersetCeleryFlower.podSecurityContext | object | `{}` | | +| supersetCeleryFlower.readinessProbe.failureThreshold | int | `3` | | +| supersetCeleryFlower.readinessProbe.httpGet.path | string | `"/api/workers"` | | +| supersetCeleryFlower.readinessProbe.httpGet.port | string | `"flower"` | | +| supersetCeleryFlower.readinessProbe.initialDelaySeconds | int | `5` | | +| supersetCeleryFlower.readinessProbe.periodSeconds | int | `5` | | +| supersetCeleryFlower.readinessProbe.successThreshold | int | `1` | | +| supersetCeleryFlower.readinessProbe.timeoutSeconds | int | `1` | | +| supersetCeleryFlower.replicaCount | int | `1` | | +| supersetCeleryFlower.resources | object | `{}` | Resource settings for the CeleryBeat pods - these settings overwrite might existing values from the global resources object defined above. | +| supersetCeleryFlower.service.annotations | object | `{}` | | +| supersetCeleryFlower.service.port | int | `5555` | | +| supersetCeleryFlower.service.type | string | `"ClusterIP"` | | +| supersetCeleryFlower.startupProbe.failureThreshold | int | `60` | | +| supersetCeleryFlower.startupProbe.httpGet.path | string | `"/api/workers"` | | +| supersetCeleryFlower.startupProbe.httpGet.port | string | `"flower"` | | +| supersetCeleryFlower.startupProbe.initialDelaySeconds | int | `5` | | +| supersetCeleryFlower.startupProbe.periodSeconds | int | `5` | | +| supersetCeleryFlower.startupProbe.successThreshold | int | `1` | | +| supersetCeleryFlower.startupProbe.timeoutSeconds | int | `1` | | | supersetNode.command | list | See `values.yaml` | Startup command | | supersetNode.connections.db_host | string | `"{{ template \"superset.fullname\" . }}-postgresql"` | | | supersetNode.connections.db_name | string | `"superset"` | | @@ -132,7 +140,7 @@ helm install my-superset superset/superset | supersetNode.deploymentAnnotations | object | `{}` | Annotations to be added to supersetNode deployment | | supersetNode.env | object | `{}` | | | supersetNode.forceReload | bool | `false` | If true, forces deployment to reload on each upgrade | -| supersetNode.initContainers | list | a container waiting for postgres to be up | Init containers | +| supersetNode.initContainers | list | a container waiting for postgres | Init containers | | supersetNode.livenessProbe.failureThreshold | int | `3` | | | supersetNode.livenessProbe.httpGet.path | string | `"/health"` | | | supersetNode.livenessProbe.httpGet.port | string | `"http"` | | @@ -204,7 +212,7 @@ helm install my-superset superset/superset | supersetWorker.containerSecurityContext | object | `{}` | | | supersetWorker.deploymentAnnotations | object | `{}` | Annotations to be added to supersetWorker deployment | | supersetWorker.forceReload | bool | `false` | If true, forces deployment to reload on each upgrade | -| supersetWorker.initContainers | list | a container waiting for postgres | Init container | +| supersetWorker.initContainers | list | a container waiting for postgres and redis | Init container | | supersetWorker.livenessProbe.exec.command | list | a `celery inspect ping` command | Liveness probe command | | supersetWorker.livenessProbe.failureThreshold | int | `3` | | | supersetWorker.livenessProbe.initialDelaySeconds | int | `120` | | diff --git a/helm/superset/templates/deployment-beat.yaml b/helm/superset/templates/deployment-beat.yaml index a5bf73457ef11..2988c7755367a 100644 --- a/helm/superset/templates/deployment-beat.yaml +++ b/helm/superset/templates/deployment-beat.yaml @@ -112,59 +112,6 @@ spec: {{- else }} {{- toYaml .Values.resources | nindent 12 }} {{- end }} - {{- if .Values.supersetCeleryBeat.flower.enabled }} - - name: "{{ .Chart.Name }}-flower" - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- if .Values.supersetCeleryBeat.containerSecurityContext }} - securityContext: {{- toYaml .Values.supersetCeleryBeat.containerSecurityContext | nindent 12 }} - {{- end }} - command: {{ tpl (toJson .Values.supersetCeleryBeat.flower.command) . }} - env: - {{- range $key, $value := .Values.extraEnv }} - - name: {{ $key | quote}} - value: {{ $value | quote }} - {{- end }} - {{- if .Values.extraEnvRaw }} - {{- toYaml .Values.extraEnvRaw | nindent 12 }} - {{- end }} - envFrom: - - secretRef: - name: {{ tpl .Values.envFromSecret . | quote }} - {{- range .Values.envFromSecrets }} - - secretRef: - name: {{ tpl . $ | quote }} - {{- end }} - ports: - - name: flower - containerPort: 5555 - protocol: TCP - volumeMounts: - - name: superset-config - mountPath: {{ .Values.configMountPath | quote }} - readOnly: true - {{- with .Values.extraVolumeMounts }} - {{- tpl (toYaml .) $ | nindent 12 -}} - {{- end }} - {{- if .Values.supersetCeleryBeat.flower.startupProbe }} - startupProbe: - {{- .Values.supersetCeleryBeat.flower.startupProbe | toYaml | nindent 12 }} - {{- end }} - {{- if .Values.supersetCeleryBeat.flower.readinessProbe }} - readinessProbe: - {{- .Values.supersetCeleryBeat.flower.readinessProbe | toYaml | nindent 12 }} - {{- end }} - {{- if .Values.supersetCeleryBeat.flower.livenessProbe }} - livenessProbe: - {{- .Values.supersetCeleryBeat.flower.livenessProbe | toYaml | nindent 12 }} - {{- end }} - resources: - {{- if .Values.supersetCeleryBeat.resources }} - {{- toYaml .Values.supersetCeleryBeat.resources | nindent 12 }} - {{- else }} - {{- toYaml .Values.resources | nindent 12 }} - {{- end }} - {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/helm/superset/templates/deployment-flower.yaml b/helm/superset/templates/deployment-flower.yaml new file mode 100644 index 0000000000000..35b31cf55e238 --- /dev/null +++ b/helm/superset/templates/deployment-flower.yaml @@ -0,0 +1,142 @@ +{{- if .Values.supersetCeleryFlower.enabled -}} +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ template "superset.fullname" . }}-flower + labels: + app: {{ template "superset.name" . }}-flower + chart: {{ template "superset.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + {{- if .Values.supersetCeleryFlower.deploymentAnnotations }} + annotations: + {{- toYaml .Values.supersetCeleryFlower.deploymentAnnotations | nindent 4 }} + {{- end }} +spec: + replicas: {{ .Values.supersetCeleryFlower.replicaCount }} + selector: + matchLabels: + app: {{ template "superset.name" . }}-flower + release: {{ .Release.Name }} + template: + metadata: + annotations: + checksum/config: {{ include "superset-config" . | sha256sum }} + checksum/secrets: {{ tpl (toJson .Values.extraSecretEnv) . | sha256sum }} + {{- if .Values.supersetCeleryFlower.podAnnotations }} + {{- toYaml .Values.supersetCeleryFlower.podAnnotations | nindent 8 }} + {{- end }} + labels: + app: "{{ template "superset.name" . }}-flower" + release: {{ .Release.Name }} + {{- if .Values.supersetCeleryFlower.podLabels }} + {{- toYaml .Values.supersetCeleryFlower.podLabels | nindent 8 }} + {{- end }} + spec: + {{- if or (.Values.serviceAccount.create) (.Values.serviceAccountName) }} + serviceAccountName: {{ template "superset.serviceAccountName" . }} + {{- end }} + securityContext: + runAsUser: {{ .Values.runAsUser }} + {{- if .Values.supersetCeleryFlower.podSecurityContext }} + {{- toYaml .Values.supersetCeleryFlower.podSecurityContext | nindent 8 }} + {{- end }} + {{- if .Values.supersetCeleryFlower.initContainers }} + initContainers: + {{- tpl (toYaml .Values.supersetCeleryFlower.initContainers) . | nindent 6 }} + {{- end }} + {{- with .Values.hostAliases }} + hostAliases: {{- toYaml . | nindent 6 }} + {{- end }} + containers: + - name: "{{ .Chart.Name }}-flower" + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.supersetCeleryFlower.containerSecurityContext }} + securityContext: {{- toYaml .Values.supersetCeleryFlower.containerSecurityContext | nindent 12 }} + {{- end }} + command: {{ tpl (toJson .Values.supersetCeleryFlower.command) . }} + env: + {{- range $key, $value := .Values.extraEnv }} + - name: {{ $key | quote}} + value: {{ $value | quote }} + {{- end }} + {{- if .Values.extraEnvRaw }} + {{- toYaml .Values.extraEnvRaw | nindent 12 }} + {{- end }} + envFrom: + - secretRef: + name: {{ tpl .Values.envFromSecret . | quote }} + {{- range .Values.envFromSecrets }} + - secretRef: + name: {{ tpl . $ | quote }} + {{- end }} + ports: + - name: flower + containerPort: 5555 + protocol: TCP + volumeMounts: + - name: superset-config + mountPath: {{ .Values.configMountPath | quote }} + readOnly: true + {{- with .Values.extraVolumeMounts }} + {{- tpl (toYaml .) $ | nindent 12 -}} + {{- end }} + {{- if .Values.supersetCeleryFlower.startupProbe }} + startupProbe: + {{- .Values.supersetCeleryFlower.startupProbe | toYaml | nindent 12 }} + {{- end }} + {{- if .Values.supersetCeleryFlower.readinessProbe }} + readinessProbe: + {{- .Values.supersetCeleryFlower.readinessProbe | toYaml | nindent 12 }} + {{- end }} + {{- if .Values.supersetCeleryFlower.livenessProbe }} + livenessProbe: + {{- .Values.supersetCeleryFlower.livenessProbe | toYaml | nindent 12 }} + {{- end }} + resources: + {{- if .Values.supersetCeleryFlower.resources }} + {{- toYaml .Values.supersetCeleryFlower.resources | nindent 12 }} + {{- else }} + {{- toYaml .Values.resources | nindent 12 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- if .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml .Values.imagePullSecrets | nindent 8 }} + {{- end }} + volumes: + - name: superset-config + secret: + secretName: {{ tpl .Values.configFromSecret . }} + {{- with .Values.extraVolumes }} + {{- tpl (toYaml .) $ | nindent 8 -}} + {{- end }} +{{- end -}} diff --git a/helm/superset/templates/deployment-ws.yaml b/helm/superset/templates/deployment-ws.yaml index e550bccb29b13..735edc8330ffb 100644 --- a/helm/superset/templates/deployment-ws.yaml +++ b/helm/superset/templates/deployment-ws.yaml @@ -42,6 +42,7 @@ spec: metadata: annotations: checksum/wsconfig: {{ tpl (toJson .Values.supersetWebsockets.config) . | sha256sum }} + checksum/secrets: {{ tpl (toJson .Values.extraSecretEnv) . | sha256sum }} {{- if .Values.supersetWebsockets.podAnnotations }} {{- toYaml .Values.supersetWebsockets.podAnnotations | nindent 8 }} {{- end }} diff --git a/helm/superset/templates/service.yaml b/helm/superset/templates/service.yaml index 83dd3fb494655..431d03704e551 100644 --- a/helm/superset/templates/service.yaml +++ b/helm/superset/templates/service.yaml @@ -41,7 +41,7 @@ spec: loadBalancerIP: {{ .Values.service.loadBalancerIP }} {{- end }} --- -{{- if .Values.supersetCeleryBeat.flower.enabled }} +{{- if .Values.supersetCeleryFlower.enabled }} apiVersion: v1 kind: Service metadata: @@ -51,22 +51,22 @@ metadata: chart: {{ template "superset.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} -{{- with .Values.supersetCeleryBeat.flower.service.annotations }} + {{- with .Values.supersetCeleryFlower.service.annotations }} annotations: -{{- toYaml . | nindent 4 }} -{{- end }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: - type: {{ .Values.supersetCeleryBeat.flower.service.type }} + type: {{ .Values.supersetCeleryFlower.service.type }} ports: - - port: {{ .Values.supersetCeleryBeat.flower.service.port }} + - port: {{ .Values.supersetCeleryFlower.service.port }} targetPort: flower protocol: TCP name: flower selector: - app: {{ template "superset.name" . }}-celerybeat + app: {{ template "superset.name" . }}-flower release: {{ .Release.Name }} - {{- if .Values.supersetCeleryBeat.flower.service.loadBalancerIP }} - loadBalancerIP: {{ .Values.supersetCeleryBeat.flower.service.loadBalancerIP }} + {{- if .Values.supersetCeleryFlower.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.supersetCeleryFlower.service.loadBalancerIP }} {{- end }} {{- end }} --- diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml index 24b6e410ad60a..686c7e1226a6c 100644 --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -267,20 +267,18 @@ supersetNode: # -- If true, forces deployment to reload on each upgrade forceReload: false # -- Init containers - # @default -- a container waiting for postgres to be up + # @default -- a container waiting for postgres initContainers: - name: wait-for-postgres - image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" - imagePullPolicy: "{{ .Values.initImage.pullPolicy }}" + image: jwilder/dockerize + imagePullPolicy: IfNotPresent envFrom: - secretRef: name: "{{ tpl .Values.envFromSecret . }}" command: - [ - "/bin/sh", - "-c", - "until nc -zv $DB_HOST $DB_PORT -w1; do echo 'waiting for db'; sleep 1; done", - ] + - /bin/sh + - -c + - dockerize -wait "tcp://$DB_HOST:$DB_PORT" -timeout 120s # -- Annotations to be added to supersetNode deployment deploymentAnnotations: {} # -- Annotations to be added to supersetNode pods @@ -344,20 +342,18 @@ supersetWorker: # -- If true, forces deployment to reload on each upgrade forceReload: false # -- Init container - # @default -- a container waiting for postgres + # @default -- a container waiting for postgres and redis initContainers: - - name: wait-for-postgres - image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" - imagePullPolicy: "{{ .Values.initImage.pullPolicy }}" + - name: wait-for-postgres-redis + image: jwilder/dockerize + imagePullPolicy: IfNotPresent envFrom: - secretRef: name: "{{ tpl .Values.envFromSecret . }}" command: - [ - "/bin/sh", - "-c", - "until nc -zv $DB_HOST $DB_PORT -w1; do echo 'waiting for db'; sleep 1; done", - ] + - /bin/sh + - -c + - dockerize -wait "tcp://$DB_HOST:$DB_PORT" -wait "tcp://$REDIS_HOST:$REDIS_PORT" -timeout 120s # -- Annotations to be added to supersetWorker deployment deploymentAnnotations: {} # -- Annotations to be added to supersetWorker pods @@ -404,70 +400,100 @@ supersetCeleryBeat: # -- This is only required if you intend to use alerts and reports enabled: false # -- Command - # @default -- a port wait command + # @default -- a `celery beat` command command: - "/bin/sh" - "-c" - ". {{ .Values.configMountPath }}/superset_bootstrap.sh; celery --app=superset.tasks.celery_app:app beat --pidfile /tmp/celerybeat.pid --schedule /tmp/celerybeat-schedule" # -- If true, forces deployment to reload on each upgrade forceReload: false - flower: - # -- If true, will expose a web-based UI to monitor jobs - # WARNING: requires a Superset image that has `flower<1.0.0` installed (which is NOT the case of the default images) - # flower>=1.0.0 requires Celery 5+ which Superset does not support - enabled: false - # -- Command - # @default -- a `celery flower` command - command: - - "/bin/sh" - - "-c" - - ". {{ .Values.configMountPath }}/superset_bootstrap.sh; celery --app=superset.tasks.celery_app:app flower" - service: - type: ClusterIP - annotations: {} - port: 5555 - startupProbe: - httpGet: - path: /api/workers - port: flower - initialDelaySeconds: 5 - timeoutSeconds: 1 - failureThreshold: 60 - periodSeconds: 5 - successThreshold: 1 - livenessProbe: - httpGet: - path: /api/workers - port: flower - initialDelaySeconds: 5 - timeoutSeconds: 1 - failureThreshold: 3 - periodSeconds: 5 - successThreshold: 1 - readinessProbe: - httpGet: - path: /api/workers - port: flower - initialDelaySeconds: 5 - timeoutSeconds: 1 - failureThreshold: 3 - periodSeconds: 5 - successThreshold: 1 # -- List of init containers # @default -- a container waiting for postgres initContainers: - - name: wait-for-postgres - image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" - imagePullPolicy: "{{ .Values.initImage.pullPolicy }}" + - name: wait-for-postgres-redis + image: jwilder/dockerize + imagePullPolicy: IfNotPresent envFrom: - secretRef: name: "{{ tpl .Values.envFromSecret . }}" command: - [ - "/bin/sh", - "-c", - "until nc -zv $DB_HOST $DB_PORT -w1; do echo 'waiting for db'; sleep 1; done", - ] + - /bin/sh + - -c + - dockerize -wait "tcp://$DB_HOST:$DB_PORT" -wait "tcp://$REDIS_HOST:$REDIS_PORT" -timeout 120s + # -- Annotations to be added to supersetCeleryBeat deployment + deploymentAnnotations: {} + # -- Annotations to be added to supersetCeleryBeat pods + podAnnotations: {} + # -- Labels to be added to supersetCeleryBeat pods + podLabels: {} + # -- Resource settings for the CeleryBeat pods - these settings overwrite might existing values from the global resources object defined above. + resources: + {} + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + podSecurityContext: {} + containerSecurityContext: {} + +supersetCeleryFlower: + # -- Enables a Celery flower deployment (management UI to monitor celery jobs) + # WARNING: requires a Superset image that has `flower<1.0.0` installed (which is NOT the case of the default images) + # flower>=1.0.0 requires Celery 5+ which Superset does not support + enabled: false + replicaCount: 1 + # -- Command + # @default -- a `celery flower` command + command: + - "/bin/sh" + - "-c" + - "celery --app=superset.tasks.celery_app:app flower" + service: + type: ClusterIP + annotations: {} + port: 5555 + startupProbe: + httpGet: + path: /api/workers + port: flower + initialDelaySeconds: 5 + timeoutSeconds: 1 + failureThreshold: 60 + periodSeconds: 5 + successThreshold: 1 + livenessProbe: + httpGet: + path: /api/workers + port: flower + initialDelaySeconds: 5 + timeoutSeconds: 1 + failureThreshold: 3 + periodSeconds: 5 + successThreshold: 1 + readinessProbe: + httpGet: + path: /api/workers + port: flower + initialDelaySeconds: 5 + timeoutSeconds: 1 + failureThreshold: 3 + periodSeconds: 5 + successThreshold: 1 + # -- List of init containers + # @default -- a container waiting for postgres and redis + initContainers: + - name: wait-for-postgres-redis + image: jwilder/dockerize + imagePullPolicy: IfNotPresent + envFrom: + - secretRef: + name: "{{ tpl .Values.envFromSecret . }}" + command: + - /bin/sh + - -c + - dockerize -wait "tcp://$DB_HOST:$DB_PORT" -wait "tcp://$REDIS_HOST:$REDIS_PORT" -timeout 120s # -- Annotations to be added to supersetCeleryBeat deployment deploymentAnnotations: {} # -- Annotations to be added to supersetCeleryBeat pods @@ -594,17 +620,15 @@ init: # @default -- a container waiting for postgres initContainers: - name: wait-for-postgres - image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" - imagePullPolicy: "{{ .Values.initImage.pullPolicy }}" + image: jwilder/dockerize + imagePullPolicy: IfNotPresent envFrom: - secretRef: name: "{{ tpl .Values.envFromSecret . }}" command: - [ - "/bin/sh", - "-c", - "until nc -zv $DB_HOST $DB_PORT -w1; do echo 'waiting for db'; sleep 1; done", - ] + - /bin/sh + - -c + - dockerize -wait "tcp://$DB_HOST:$DB_PORT" -timeout 120s # -- A Superset init script # @default -- a script to create admin user and initailize roles initscript: |- From 7b812f72ccf313f84061a1a0989768c92884d0ff Mon Sep 17 00:00:00 2001 From: Yann Jouanique Date: Tue, 25 Oct 2022 12:09:02 +0200 Subject: [PATCH 06/12] helm: Use shared default for init image --- helm/superset/README.md | 2 +- helm/superset/values.yaml | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/helm/superset/README.md b/helm/superset/README.md index 61509c4174af9..c4ef6d12edf0c 100644 --- a/helm/superset/README.md +++ b/helm/superset/README.md @@ -71,7 +71,7 @@ helm install my-superset superset/superset | init.podSecurityContext | object | `{}` | | | init.resources | object | `{}` | | | initImage.pullPolicy | string | `"IfNotPresent"` | | -| initImage.repository | string | `"busybox"` | | +| initImage.repository | string | `"jwilder/dockerize"` | | | initImage.tag | string | `"latest"` | | | nodeSelector | object | `{}` | | | postgresql | object | see `values.yaml` | Configuration values for the postgresql dependency. ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md | diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml index 686c7e1226a6c..421803c68332c 100644 --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -190,7 +190,7 @@ image: imagePullSecrets: [] initImage: - repository: busybox + repository: jwilder/dockerize tag: latest pullPolicy: IfNotPresent @@ -270,8 +270,8 @@ supersetNode: # @default -- a container waiting for postgres initContainers: - name: wait-for-postgres - image: jwilder/dockerize - imagePullPolicy: IfNotPresent + image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" + imagePullPolicy: "{{ .Values.initImage.pullPolicy }}" envFrom: - secretRef: name: "{{ tpl .Values.envFromSecret . }}" @@ -345,8 +345,8 @@ supersetWorker: # @default -- a container waiting for postgres and redis initContainers: - name: wait-for-postgres-redis - image: jwilder/dockerize - imagePullPolicy: IfNotPresent + image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" + imagePullPolicy: "{{ .Values.initImage.pullPolicy }}" envFrom: - secretRef: name: "{{ tpl .Values.envFromSecret . }}" @@ -411,8 +411,8 @@ supersetCeleryBeat: # @default -- a container waiting for postgres initContainers: - name: wait-for-postgres-redis - image: jwilder/dockerize - imagePullPolicy: IfNotPresent + image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" + imagePullPolicy: "{{ .Values.initImage.pullPolicy }}" envFrom: - secretRef: name: "{{ tpl .Values.envFromSecret . }}" @@ -485,8 +485,8 @@ supersetCeleryFlower: # @default -- a container waiting for postgres and redis initContainers: - name: wait-for-postgres-redis - image: jwilder/dockerize - imagePullPolicy: IfNotPresent + image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" + imagePullPolicy: "{{ .Values.initImage.pullPolicy }}" envFrom: - secretRef: name: "{{ tpl .Values.envFromSecret . }}" @@ -620,8 +620,8 @@ init: # @default -- a container waiting for postgres initContainers: - name: wait-for-postgres - image: jwilder/dockerize - imagePullPolicy: IfNotPresent + image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" + imagePullPolicy: "{{ .Values.initImage.pullPolicy }}" envFrom: - secretRef: name: "{{ tpl .Values.envFromSecret . }}" From df0ae8d8be8fda7be1ce558c8ebb187608a619f8 Mon Sep 17 00:00:00 2001 From: Yann Jouanique Date: Tue, 25 Oct 2022 18:25:10 +0200 Subject: [PATCH 07/12] helm: update worker probe health check for celery 5+ compatibility --- helm/superset/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml index 421803c68332c..3d3eaaf9e15ef 100644 --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -384,7 +384,7 @@ supersetWorker: command: - sh - -c - - celery inspect ping -A superset.tasks.celery_app:app -d celery@$HOSTNAME + - celery -A superset.tasks.celery_app:app inspect ping -d celery@$HOSTNAME initialDelaySeconds: 120 timeoutSeconds: 60 failureThreshold: 3 From c8df3b09563c811b1a52d57e01739649583932df Mon Sep 17 00:00:00 2001 From: Yann Jouanique Date: Tue, 25 Oct 2022 18:26:19 +0200 Subject: [PATCH 08/12] helm: update flower version warning for superset 2.0 --- helm/superset/README.md | 2 +- helm/superset/values.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/helm/superset/README.md b/helm/superset/README.md index c4ef6d12edf0c..f3b64611061a8 100644 --- a/helm/superset/README.md +++ b/helm/superset/README.md @@ -97,7 +97,7 @@ helm install my-superset superset/superset | supersetCeleryFlower.command | list | a `celery flower` command | Command | | supersetCeleryFlower.containerSecurityContext | object | `{}` | | | supersetCeleryFlower.deploymentAnnotations | object | `{}` | Annotations to be added to supersetCeleryBeat deployment | -| supersetCeleryFlower.enabled | bool | `false` | Enables a Celery flower deployment (management UI to monitor celery jobs) WARNING: requires a Superset image that has `flower<1.0.0` installed (which is NOT the case of the default images) flower>=1.0.0 requires Celery 5+ which Superset does not support | +| supersetCeleryFlower.enabled | bool | `false` | Enables a Celery flower deployment (management UI to monitor celery jobs) WARNING: on superset 1.x, this requires a Superset image that has `flower<1.0.0` installed (which is NOT the case of the default images) flower>=1.0.0 requires Celery 5+ which Superset 1.5 does not support | | supersetCeleryFlower.initContainers | list | a container waiting for postgres and redis | List of init containers | | supersetCeleryFlower.livenessProbe.failureThreshold | int | `3` | | | supersetCeleryFlower.livenessProbe.httpGet.path | string | `"/api/workers"` | | diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml index 3d3eaaf9e15ef..98aabbb13cf3e 100644 --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -440,8 +440,8 @@ supersetCeleryBeat: supersetCeleryFlower: # -- Enables a Celery flower deployment (management UI to monitor celery jobs) - # WARNING: requires a Superset image that has `flower<1.0.0` installed (which is NOT the case of the default images) - # flower>=1.0.0 requires Celery 5+ which Superset does not support + # WARNING: on superset 1.x, this requires a Superset image that has `flower<1.0.0` installed (which is NOT the case of the default images) + # flower>=1.0.0 requires Celery 5+ which Superset 1.5 does not support enabled: false replicaCount: 1 # -- Command From ef0855ea39106b378155d0975ae1e990aaf97b96 Mon Sep 17 00:00:00 2001 From: Yann Jouanique Date: Thu, 27 Oct 2022 11:17:08 +0200 Subject: [PATCH 09/12] helm: provide dependent repo to chart-testing --- .github/workflows/superset-helm-lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/superset-helm-lint.yml b/.github/workflows/superset-helm-lint.yml index a7f83f561ac25..d0e650839f9a4 100644 --- a/.github/workflows/superset-helm-lint.yml +++ b/.github/workflows/superset-helm-lint.yml @@ -44,3 +44,4 @@ jobs: CT_CHART_DIRS: helm CT_LINT_CONF: lintconf.yaml CT_SINCE: HEAD + CT_CHART_REPOS: bitnami=https://charts.bitnami.com/bitnami From fc37ba76c2d72a2852fc252ecfe9d2c47aa04770 Mon Sep 17 00:00:00 2001 From: Yann Jouanique Date: Thu, 27 Oct 2022 11:56:57 +0200 Subject: [PATCH 10/12] helm: fix conflict betwee prettier and yamllint conf --- lintconf.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lintconf.yaml b/lintconf.yaml index 7a62003d95079..5a7c114c6d18c 100644 --- a/lintconf.yaml +++ b/lintconf.yaml @@ -18,7 +18,7 @@ rules: braces: min-spaces-inside: 0 - max-spaces-inside: 0 + max-spaces-inside: 1 min-spaces-inside-empty: -1 max-spaces-inside-empty: -1 brackets: @@ -37,7 +37,7 @@ rules: require-starting-space: false min-spaces-from-content: -1 document-end: disable - document-start: disable # No --- to start a file + document-start: disable # No --- to start a file empty-lines: max: 2 max-start: 0 @@ -46,10 +46,10 @@ rules: max-spaces-after: 1 indentation: spaces: consistent - indent-sequences: whatever # - list indentation will handle both indentation and without + indent-sequences: whatever # - list indentation will handle both indentation and without check-multi-line-strings: false key-duplicates: enable - line-length: disable # Lines can be any length + line-length: disable # Lines can be any length new-line-at-end-of-file: enable new-lines: type: unix From 846cce9ee4ad266ac79b8cfbfc007c2414ea921d Mon Sep 17 00:00:00 2001 From: Yann Jouanique Date: Thu, 27 Oct 2022 12:48:54 +0200 Subject: [PATCH 11/12] Some doc polishing --- .markdownlint.json | 4 ++++ helm/superset/Chart.yaml | 1 + helm/superset/README.md | 2 +- helm/superset/README.md.gotmpl | 2 +- helm/superset/values.yaml | 3 +-- 5 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 .markdownlint.json diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000000000..dcc40721cea28 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,4 @@ +{ + "no-bare-urls": false, + "line-length": false +} diff --git a/helm/superset/Chart.yaml b/helm/superset/Chart.yaml index 2b00677ea1b79..027e52ab3b689 100644 --- a/helm/superset/Chart.yaml +++ b/helm/superset/Chart.yaml @@ -18,6 +18,7 @@ apiVersion: v2 appVersion: "1.0" description: Apache Superset is a modern, enterprise-ready business intelligence web application name: superset +icon: https://artifacthub.io/image/68c1d717-0e97-491f-b046-754e46f46922@2x home: https://superset.apache.org/ keywords: - business intelligence diff --git a/helm/superset/README.md b/helm/superset/README.md index f3b64611061a8..68c27867ba06a 100644 --- a/helm/superset/README.md +++ b/helm/superset/README.md @@ -10,7 +10,7 @@ Apache Superset is a modern, enterprise-ready business intelligence web applicat * -## TL;DR; +## TL;DR ```console helm repo add superset http://apache.github.io/superset/ diff --git a/helm/superset/README.md.gotmpl b/helm/superset/README.md.gotmpl index 78881165c9f87..f282d340cc939 100644 --- a/helm/superset/README.md.gotmpl +++ b/helm/superset/README.md.gotmpl @@ -9,7 +9,7 @@ {{ template "chart.sourcesSection" . }} -## TL;DR; +## TL;DR ```console helm repo add superset http://apache.github.io/superset/ diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml index 98aabbb13cf3e..5acc9805867bf 100644 --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -136,13 +136,12 @@ extraVolumeMounts: # Files can be passed as helm --set-file configOverrides.my-override=my-file.py configOverrides: {} - # extend_timeout: | + # extend_timeout: | # # Extend timeout to allow long running queries. # SUPERSET_WEBSERVER_TIMEOUT = ... # enable_oauth: | # from flask_appbuilder.security.manager import (AUTH_DB, AUTH_OAUTH) # AUTH_TYPE = AUTH_OAUTH - # OAUTH_PROVIDERS = [ # { # "name": "google", From bf5cafe1255ca30bf4d53349ffedf99078de96c2 Mon Sep 17 00:00:00 2001 From: Yann Jouanique Date: Thu, 27 Oct 2022 14:11:02 +0200 Subject: [PATCH 12/12] Add license in Helm README --- helm/superset/README.md | 19 +++++++++++++++++++ helm/superset/README.md.gotmpl | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/helm/superset/README.md b/helm/superset/README.md index 68c27867ba06a..f894251132f5e 100644 --- a/helm/superset/README.md +++ b/helm/superset/README.md @@ -1,3 +1,22 @@ + + # superset ![Version: 0.7.5](https://img.shields.io/badge/Version-0.7.5-informational?style=flat-square) diff --git a/helm/superset/README.md.gotmpl b/helm/superset/README.md.gotmpl index f282d340cc939..e00c527e83ebd 100644 --- a/helm/superset/README.md.gotmpl +++ b/helm/superset/README.md.gotmpl @@ -1,3 +1,22 @@ + + {{ template "chart.header" . }} {{ template "chart.deprecationWarning" . }}