From 70f3cc0b27ee7a9801b3341701b939e8a4bdd2e8 Mon Sep 17 00:00:00 2001 From: Denis Krivenko Date: Tue, 18 Apr 2023 18:37:23 +0200 Subject: [PATCH] chore(helm): Reformat helm chart templates (#23681) --- helm/superset/templates/NOTES.txt | 4 +- helm/superset/templates/_helpers.tpl | 45 ++++----- .../templates/configmap-superset.yaml | 8 +- helm/superset/templates/deployment-beat.yaml | 75 +++++++-------- .../superset/templates/deployment-flower.yaml | 76 +++++++-------- .../superset/templates/deployment-worker.yaml | 95 +++++++++--------- helm/superset/templates/deployment-ws.yaml | 68 ++++++------- helm/superset/templates/deployment.yaml | 96 +++++++++---------- helm/superset/templates/ingress.yaml | 21 ++-- helm/superset/templates/init-job.yaml | 48 ++++------ helm/superset/templates/secret-env.yaml | 2 +- .../templates/secret-superset-config.yaml | 18 ++-- helm/superset/templates/secret-ws.yaml | 6 +- helm/superset/templates/service-account.yaml | 2 +- helm/superset/templates/service.yaml | 19 ++-- helm/superset/values.yaml | 51 ++++------ 16 files changed, 284 insertions(+), 350 deletions(-) diff --git a/helm/superset/templates/NOTES.txt b/helm/superset/templates/NOTES.txt index 07fcba3810..6a686d2c40 100644 --- a/helm/superset/templates/NOTES.txt +++ b/helm/superset/templates/NOTES.txt @@ -18,9 +18,9 @@ */}} 1. Get the application URL by running these commands: {{- if .Values.ingress.enabled }} -{{- range .Values.ingress.hosts }} + {{- range .Values.ingress.hosts }} http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} -{{- end }} + {{- end }} {{- else if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "superset.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") diff --git a/helm/superset/templates/_helpers.tpl b/helm/superset/templates/_helpers.tpl index d551fcf6e8..67f018095d 100644 --- a/helm/superset/templates/_helpers.tpl +++ b/helm/superset/templates/_helpers.tpl @@ -21,7 +21,7 @@ Expand the name of the chart. */}} {{- define "superset.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} + {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* @@ -30,34 +30,34 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this If release name contains chart name it will be used as a full name. */}} {{- define "superset.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} + {{- if .Values.fullnameOverride -}} + {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} + {{- else -}} + {{- $name := default .Chart.Name .Values.nameOverride -}} + {{- if contains $name .Release.Name -}} + {{- .Release.Name | trunc 63 | trimSuffix "-" -}} + {{- else -}} + {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} + {{- end -}} + {{- end -}} {{- end -}} {{/* Create the name of the service account to use */}} {{- define "superset.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} -{{- default (include "superset.fullname" .) .Values.serviceAccountName -}} -{{- else -}} -{{- default "default" .Values.serviceAccountName -}} -{{- end -}} + {{- if .Values.serviceAccount.create -}} + {{- default (include "superset.fullname" .) .Values.serviceAccountName -}} + {{- else -}} + {{- default "default" .Values.serviceAccountName -}} + {{- end -}} {{- end -}} {{/* Create chart name and version as used by the chart label. */}} {{- define "superset.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} + {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} {{- define "superset-config" }} @@ -86,20 +86,20 @@ SECRET_KEY = env('SECRET_KEY', 'thisISaSECRET_1234') class CeleryConfig(object): CELERY_IMPORTS = ('superset.sql_lab', ) CELERY_ANNOTATIONS = {'tasks.add': {'rate_limit': '10/s'}} -{{- if .Values.supersetNode.connections.redis_password }} + {{- if .Values.supersetNode.connections.redis_password }} BROKER_URL = f"redis://:{env('REDIS_PASSWORD')}@{env('REDIS_HOST')}:{env('REDIS_PORT')}/0" CELERY_RESULT_BACKEND = f"redis://:{env('REDIS_PASSWORD')}@{env('REDIS_HOST')}:{env('REDIS_PORT')}/0" -{{- else }} + {{- else }} BROKER_URL = f"redis://{env('REDIS_HOST')}:{env('REDIS_PORT')}/0" CELERY_RESULT_BACKEND = f"redis://{env('REDIS_HOST')}:{env('REDIS_PORT')}/0" -{{- end }} + {{- end }} CELERY_CONFIG = CeleryConfig RESULTS_BACKEND = RedisCache( host=env('REDIS_HOST'), -{{- if .Values.supersetNode.connections.redis_password }} + {{- if .Values.supersetNode.connections.redis_password }} password=env('REDIS_PASSWORD'), -{{- end }} + {{- end }} port=env('REDIS_PORT'), key_prefix='superset_results' ) @@ -111,6 +111,7 @@ RESULTS_BACKEND = RedisCache( {{ tpl $value $ }} {{- end }} {{- end }} + {{ if .Values.configOverridesFiles }} # Overrides from files {{- $files := .Files }} diff --git a/helm/superset/templates/configmap-superset.yaml b/helm/superset/templates/configmap-superset.yaml index eb8564619b..fee59cbbd8 100644 --- a/helm/superset/templates/configmap-superset.yaml +++ b/helm/superset/templates/configmap-superset.yaml @@ -19,15 +19,15 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ template "superset.fullname" . }}-extra-config + namespace: {{ .Release.Namespace }} labels: app: {{ template "superset.name" . }} chart: {{ template "superset.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} - namespace: {{ .Release.Namespace }} data: -{{- range $path, $config := .Values.extraConfigs }} + {{- range $path, $config := .Values.extraConfigs }} {{ $path }}: | -{{- tpl $config $ | nindent 4 -}} -{{- end -}} + {{- tpl $config $ | nindent 4 -}} + {{- end -}} {{- end -}} diff --git a/helm/superset/templates/deployment-beat.yaml b/helm/superset/templates/deployment-beat.yaml index 72de7ab204..628ba6195a 100644 --- a/helm/superset/templates/deployment-beat.yaml +++ b/helm/superset/templates/deployment-beat.yaml @@ -19,16 +19,15 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "superset.fullname" . }}-celerybeat + namespace: {{ .Release.Namespace }} labels: app: {{ template "superset.name" . }}-celerybeat chart: {{ template "superset.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} -{{- if .Values.supersetCeleryBeat.deploymentAnnotations }} - annotations: - {{- toYaml .Values.supersetCeleryBeat.deploymentAnnotations | nindent 4 }} -{{- end }} - namespace: {{ .Release.Namespace }} + {{- if .Values.supersetCeleryBeat.deploymentAnnotations }} + annotations: {{- toYaml .Values.supersetCeleryBeat.deploymentAnnotations | nindent 4 }} + {{- end }} spec: # This must be a singleton replicas: 1 @@ -46,31 +45,30 @@ spec: checksum/extraSecretEnv: {{ .Values.extraSecretEnv | toYaml | sha256sum }} checksum/configOverrides: {{ .Values.configOverrides | toYaml | sha256sum }} checksum/configOverridesFiles: {{ .Values.configOverridesFiles | toYaml | sha256sum }} - {{ if .Values.supersetCeleryBeat.forceReload }} + {{- if .Values.supersetCeleryBeat.forceReload }} # Optionally force the thing to reload force-reload: {{ randAlphaNum 5 | quote }} - {{ end }} - {{- if .Values.supersetCeleryBeat.podAnnotations }} - {{- toYaml .Values.supersetCeleryBeat.podAnnotations | nindent 8 }} - {{- end }} + {{- end }} + {{- if .Values.supersetCeleryBeat.podAnnotations }} + {{- 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 }} - {{- end }} + {{- if .Values.supersetCeleryBeat.podLabels }} + {{- toYaml .Values.supersetCeleryBeat.podLabels | nindent 8 }} + {{- end }} spec: {{- if or (.Values.serviceAccount.create) (.Values.serviceAccountName) }} serviceAccountName: {{ template "superset.serviceAccountName" . }} {{- end }} securityContext: runAsUser: {{ .Values.runAsUser }} - {{- if .Values.supersetCeleryBeat.podSecurityContext }} - {{- toYaml .Values.supersetCeleryBeat.podSecurityContext | nindent 8 }} - {{- end }} + {{- if .Values.supersetCeleryBeat.podSecurityContext }} + {{- toYaml .Values.supersetCeleryBeat.podSecurityContext | nindent 8 }} + {{- end }} {{- if .Values.supersetCeleryBeat.initContainers }} - initContainers: - {{- tpl (toYaml .Values.supersetCeleryBeat.initContainers) . | nindent 6 }} + initContainers: {{- tpl (toYaml .Values.supersetCeleryBeat.initContainers) . | nindent 6 }} {{- end }} {{- with .Values.hostAliases }} hostAliases: {{- toYaml . | nindent 6 }} @@ -91,7 +89,7 @@ spec: value: {{ $value | quote }} {{- end }} {{- if .Values.extraEnvRaw }} - {{- toYaml .Values.extraEnvRaw | nindent 12 }} + {{- toYaml .Values.extraEnvRaw | nindent 12 }} {{- end }} envFrom: - secretRef: @@ -109,44 +107,41 @@ spec: mountPath: {{ .Values.extraConfigMountPath | quote }} readOnly: true {{- end }} - {{- with .Values.extraVolumeMounts }} - {{- tpl (toYaml .) $ | nindent 12 -}} - {{- end }} + {{- with .Values.extraVolumeMounts }} + {{- tpl (toYaml .) $ | nindent 12 }} + {{- end }} resources: - {{- if .Values.supersetCeleryBeat.resources }} - {{- toYaml .Values.supersetCeleryBeat.resources | nindent 12 }} - {{- else }} - {{- toYaml .Values.resources | nindent 12 }} - {{- end }} + {{- if .Values.supersetCeleryBeat.resources }} + {{- toYaml .Values.supersetCeleryBeat.resources | nindent 12 }} + {{- else }} + {{- toYaml .Values.resources | nindent 12 }} + {{- end }} {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} + nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- if or .Values.affinity .Values.supersetCeleryBeat.affinity }} affinity: {{- with .Values.affinity }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.supersetCeleryBeat.affinity }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- end }} {{- if or .Values.topologySpreadConstraints .Values.supersetCeleryBeat.topologySpreadConstraints }} topologySpreadConstraints: {{- with .Values.topologySpreadConstraints }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.supersetCeleryBeat.topologySpreadConstraints }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- end }} {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} + tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml .Values.imagePullSecrets | nindent 8 }} + imagePullSecrets: {{- toYaml .Values.imagePullSecrets | nindent 8 }} {{- end }} volumes: - name: superset-config @@ -157,7 +152,7 @@ spec: configMap: name: {{ template "superset.fullname" . }}-extra-config {{- end }} - {{- with .Values.extraVolumes }} - {{- tpl (toYaml .) $ | nindent 8 -}} - {{- end }} + {{- with .Values.extraVolumes }} + {{- tpl (toYaml .) $ | nindent 8 -}} + {{- end }} {{- end -}} diff --git a/helm/superset/templates/deployment-flower.yaml b/helm/superset/templates/deployment-flower.yaml index aefdf0f7de..3b3091c819 100644 --- a/helm/superset/templates/deployment-flower.yaml +++ b/helm/superset/templates/deployment-flower.yaml @@ -19,16 +19,15 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "superset.fullname" . }}-flower + namespace: {{ .Release.Namespace }} 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 }} + annotations: {{- toYaml .Values.supersetCeleryFlower.deploymentAnnotations | nindent 4 }} {{- end }} - namespace: {{ .Release.Namespace }} spec: replicas: {{ .Values.supersetCeleryFlower.replicaCount }} selector: @@ -40,27 +39,26 @@ spec: 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 }} + {{- 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 }} + {{- 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.podSecurityContext }} + {{- toYaml .Values.supersetCeleryFlower.podSecurityContext | nindent 8 }} + {{- end }} {{- if .Values.supersetCeleryFlower.initContainers }} - initContainers: - {{- tpl (toYaml .Values.supersetCeleryFlower.initContainers) . | nindent 6 }} + initContainers: {{- tpl (toYaml .Values.supersetCeleryFlower.initContainers) . | nindent 6 }} {{- end }} {{- with .Values.hostAliases }} hostAliases: {{- toYaml . | nindent 6 }} @@ -79,7 +77,7 @@ spec: value: {{ $value | quote }} {{- end }} {{- if .Values.extraEnvRaw }} - {{- toYaml .Values.extraEnvRaw | nindent 12 }} + {{- toYaml .Values.extraEnvRaw | nindent 12 }} {{- end }} envFrom: - secretRef: @@ -96,62 +94,56 @@ spec: - name: superset-config mountPath: {{ .Values.configMountPath | quote }} readOnly: true - {{- with .Values.extraVolumeMounts }} - {{- tpl (toYaml .) $ | nindent 12 -}} - {{- end }} + {{- with .Values.extraVolumeMounts }} + {{- tpl (toYaml .) $ | nindent 12 -}} + {{- end }} {{- if .Values.supersetCeleryFlower.startupProbe }} - startupProbe: - {{- .Values.supersetCeleryFlower.startupProbe | toYaml | nindent 12 }} + startupProbe: {{- .Values.supersetCeleryFlower.startupProbe | toYaml | nindent 12 }} {{- end }} {{- if .Values.supersetCeleryFlower.readinessProbe }} - readinessProbe: - {{- .Values.supersetCeleryFlower.readinessProbe | toYaml | nindent 12 }} + readinessProbe: {{- .Values.supersetCeleryFlower.readinessProbe | toYaml | nindent 12 }} {{- end }} {{- if .Values.supersetCeleryFlower.livenessProbe }} - livenessProbe: - {{- .Values.supersetCeleryFlower.livenessProbe | toYaml | nindent 12 }} + 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 }} + {{- if .Values.supersetCeleryFlower.resources }} + {{- toYaml .Values.supersetCeleryFlower.resources | nindent 12 }} + {{- else }} + {{- toYaml .Values.resources | nindent 12 }} + {{- end }} {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} + nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- if or .Values.affinity .Values.supersetCeleryFlower.affinity }} affinity: {{- with .Values.affinity }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.supersetCeleryFlower.affinity }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- end }} {{- if or .Values.topologySpreadConstraints .Values.supersetCeleryFlower.topologySpreadConstraints }} topologySpreadConstraints: {{- with .Values.topologySpreadConstraints }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.supersetCeleryFlower.topologySpreadConstraints }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- end }} {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} + tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml .Values.imagePullSecrets | nindent 8 }} + imagePullSecrets: {{- toYaml .Values.imagePullSecrets | nindent 8 }} {{- end }} volumes: - name: superset-config secret: secretName: {{ tpl .Values.configFromSecret . }} - {{- with .Values.extraVolumes }} - {{- tpl (toYaml .) $ | nindent 8 -}} - {{- end }} + {{- with .Values.extraVolumes }} + {{- tpl (toYaml .) $ | nindent 8 -}} + {{- end }} {{- end -}} diff --git a/helm/superset/templates/deployment-worker.yaml b/helm/superset/templates/deployment-worker.yaml index 543fa19acb..610d2fe504 100644 --- a/helm/superset/templates/deployment-worker.yaml +++ b/helm/superset/templates/deployment-worker.yaml @@ -18,19 +18,18 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "superset.fullname" . }}-worker + namespace: {{ .Release.Namespace }} labels: app: {{ template "superset.name" . }}-worker chart: {{ template "superset.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} -{{- if .Values.supersetWorker.deploymentLabels }} - {{- toYaml .Values.supersetWorker.deploymentLabels | nindent 4 }} -{{- end }} -{{- if .Values.supersetWorker.deploymentAnnotations }} - annotations: - {{- toYaml .Values.supersetWorker.deploymentAnnotations | nindent 4 }} -{{- end }} - namespace: {{ .Release.Namespace }} + {{- if .Values.supersetWorker.deploymentLabels }} + {{- toYaml .Values.supersetWorker.deploymentLabels | nindent 4 }} + {{- end }} + {{- if .Values.supersetWorker.deploymentAnnotations }} + annotations: {{- toYaml .Values.supersetWorker.deploymentAnnotations | nindent 4 }} + {{- end }} spec: replicas: {{ .Values.supersetWorker.replicaCount }} selector: @@ -38,8 +37,7 @@ spec: app: {{ template "superset.name" . }}-worker release: {{ .Release.Name }} {{- if .Values.supersetWorker.strategy }} - strategy: - {{- toYaml .Values.supersetWorker.strategy | nindent 4 }} + strategy: {{- toYaml .Values.supersetWorker.strategy | nindent 4 }} {{- end }} template: metadata: @@ -51,31 +49,30 @@ spec: checksum/extraSecretEnv: {{ .Values.extraSecretEnv | toYaml | sha256sum }} checksum/configOverrides: {{ .Values.configOverrides | toYaml | sha256sum }} checksum/configOverridesFiles: {{ .Values.configOverridesFiles | toYaml | sha256sum }} - {{ if .Values.supersetWorker.forceReload }} + {{- if .Values.supersetWorker.forceReload }} # Optionally force the thing to reload force-reload: {{ randAlphaNum 5 | quote }} - {{ end }} - {{- if .Values.supersetWorker.podAnnotations }} - {{- toYaml .Values.supersetWorker.podAnnotations | nindent 8 }} - {{- end }} + {{- end }} + {{- if .Values.supersetWorker.podAnnotations }} + {{- 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 }} - {{- end }} + {{- if .Values.supersetWorker.podLabels }} + {{- toYaml .Values.supersetWorker.podLabels | nindent 8 }} + {{- end }} spec: {{- if or (.Values.serviceAccount.create) (.Values.serviceAccountName) }} serviceAccountName: {{ template "superset.serviceAccountName" . }} {{- end }} securityContext: runAsUser: {{ .Values.runAsUser }} - {{- if .Values.supersetWorker.podSecurityContext }} - {{- toYaml .Values.supersetWorker.podSecurityContext | nindent 8 }} - {{- end }} + {{- if .Values.supersetWorker.podSecurityContext }} + {{- toYaml .Values.supersetWorker.podSecurityContext | nindent 8 }} + {{- end }} {{- if .Values.supersetWorker.initContainers }} - initContainers: - {{- tpl (toYaml .Values.supersetWorker.initContainers) . | nindent 6 }} + initContainers: {{- tpl (toYaml .Values.supersetWorker.initContainers) . | nindent 6 }} {{- end }} {{- with .Values.hostAliases }} hostAliases: {{- toYaml . | nindent 6 }} @@ -109,64 +106,58 @@ spec: - name: superset-config mountPath: {{ .Values.configMountPath | quote }} readOnly: true - {{- if .Values.extraConfigs }} + {{- if .Values.extraConfigs }} - name: superset-extra-config mountPath: {{ .Values.extraConfigMountPath | quote }} readOnly: true - {{- end }} - {{- with .Values.extraVolumeMounts }} - {{- tpl (toYaml .) $ | nindent 12 -}} - {{- end }} + {{- end }} + {{- with .Values.extraVolumeMounts }} + {{- tpl (toYaml .) $ | nindent 12 -}} + {{- end }} {{- if .Values.supersetWorker.startupProbe }} - startupProbe: - {{- .Values.supersetWorker.startupProbe | toYaml | nindent 12 }} + startupProbe: {{- .Values.supersetWorker.startupProbe | toYaml | nindent 12 }} {{- end }} {{- if .Values.supersetWorker.readinessProbe }} - readinessProbe: - {{- .Values.supersetWorker.readinessProbe | toYaml | nindent 12 }} + readinessProbe: {{- .Values.supersetWorker.readinessProbe | toYaml | nindent 12 }} {{- end }} {{- if .Values.supersetWorker.livenessProbe }} - livenessProbe: - {{- .Values.supersetWorker.livenessProbe | toYaml | nindent 12 }} + livenessProbe: {{- .Values.supersetWorker.livenessProbe | toYaml | nindent 12 }} {{- end }} resources: - {{- if .Values.supersetWorker.resources }} + {{- if .Values.supersetWorker.resources }} {{- toYaml .Values.supersetWorker.resources | nindent 12 }} - {{- else }} - {{- toYaml .Values.resources | nindent 12 }} - {{- end }} -{{- if .Values.supersetWorker.extraContainers }} -{{- toYaml .Values.supersetWorker.extraContainers | nindent 8 }} -{{- end }} + {{- else }} + {{- toYaml .Values.resources | nindent 12 }} + {{- end }} + {{- if .Values.supersetWorker.extraContainers }} + {{- toYaml .Values.supersetWorker.extraContainers | nindent 8 }} + {{- end }} {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} + nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- if or .Values.affinity .Values.supersetWorker.affinity }} affinity: {{- with .Values.affinity }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.supersetWorker.affinity }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- end }} {{- if or .Values.topologySpreadConstraints .Values.supersetWorker.topologySpreadConstraints }} topologySpreadConstraints: {{- with .Values.topologySpreadConstraints }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.supersetWorker.topologySpreadConstraints }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- end }} {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} + tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml .Values.imagePullSecrets | nindent 8 }} + imagePullSecrets: {{- toYaml .Values.imagePullSecrets | nindent 8 }} {{- end }} volumes: - name: superset-config @@ -178,5 +169,5 @@ spec: name: {{ template "superset.fullname" . }}-extra-config {{- end }} {{- with .Values.extraVolumes }} - {{- tpl (toYaml .) $ | nindent 8 -}} + {{- tpl (toYaml .) $ | nindent 8 -}} {{- end }} diff --git a/helm/superset/templates/deployment-ws.yaml b/helm/superset/templates/deployment-ws.yaml index 0bbc822ef9..4d684e83e6 100644 --- a/helm/superset/templates/deployment-ws.yaml +++ b/helm/superset/templates/deployment-ws.yaml @@ -19,16 +19,15 @@ apiVersion: apps/v1 kind: Deployment metadata: name: "{{ template "superset.fullname" . }}-ws" + namespace: {{ .Release.Namespace }} 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 }} - namespace: {{ .Release.Namespace }} + {{- if .Values.supersetWebsockets.deploymentAnnotations }} + annotations: {{- toYaml .Values.supersetWebsockets.deploymentAnnotations | nindent 4 }} + {{- end }} spec: replicas: {{ .Values.supersetWebsockets.replicaCount }} selector: @@ -36,32 +35,31 @@ spec: app: "{{ template "superset.name" . }}-ws" release: {{ .Release.Name }} {{- if .Values.supersetWebsockets.strategy }} - strategy: - {{- toYaml .Values.supersetWebsockets.strategy | nindent 4 }} + strategy: {{- toYaml .Values.supersetWebsockets.strategy | nindent 4 }} {{- end }} template: 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 }} + {{- 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 }} + {{- 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 }} + {{- if .Values.supersetWebsockets.podSecurityContext }} + {{- toYaml .Values.supersetWebsockets.podSecurityContext | nindent 8 }} + {{- end }} {{- with .Values.hostAliases }} hostAliases: {{- toYaml . | nindent 6 }} {{- end }} @@ -80,7 +78,7 @@ spec: value: {{ $value | quote }} {{- end }} {{- if .Values.extraEnvRaw }} - {{- toYaml .Values.extraEnvRaw | nindent 12 }} + {{- toYaml .Values.extraEnvRaw | nindent 12 }} {{- end }} envFrom: - secretRef: @@ -99,52 +97,46 @@ spec: 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.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 }} + startupProbe: {{- .Values.supersetWebsockets.startupProbe | toYaml | nindent 12 }} {{- end }} {{- if .Values.supersetWebsockets.readinessProbe }} - readinessProbe: - {{- .Values.supersetWebsockets.readinessProbe | toYaml | nindent 12 }} + readinessProbe: {{- .Values.supersetWebsockets.readinessProbe | toYaml | nindent 12 }} {{- end }} {{- if .Values.supersetWebsockets.livenessProbe }} - livenessProbe: - {{- .Values.supersetWebsockets.livenessProbe | toYaml | nindent 12 }} + livenessProbe: {{- .Values.supersetWebsockets.livenessProbe | toYaml | nindent 12 }} {{- end }} {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} + nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- if or .Values.affinity .Values.supersetWebsockets.affinity }} affinity: {{- with .Values.affinity }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.supersetWebsockets.affinity }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- end }} {{- if or .Values.topologySpreadConstraints .Values.supersetWebsockets.topologySpreadConstraints }} topologySpreadConstraints: {{- with .Values.topologySpreadConstraints }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.supersetWebsockets.topologySpreadConstraints }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- end }} {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} + tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml .Values.imagePullSecrets | nindent 8 }} + imagePullSecrets: {{- toYaml .Values.imagePullSecrets | nindent 8 }} {{- end }} volumes: - name: superset-ws-config diff --git a/helm/superset/templates/deployment.yaml b/helm/superset/templates/deployment.yaml index d993b934ce..e989b896d4 100644 --- a/helm/superset/templates/deployment.yaml +++ b/helm/superset/templates/deployment.yaml @@ -18,24 +18,22 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "superset.fullname" . }} + namespace: {{ .Release.Namespace }} labels: app: {{ template "superset.name" . }} chart: {{ template "superset.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} -{{- if .Values.supersetNode.deploymentLabels }} - {{- toYaml .Values.supersetNode.deploymentLabels | nindent 4 }} -{{- end }} -{{- if .Values.supersetNode.deploymentAnnotations }} - annotations: - {{- toYaml .Values.supersetNode.deploymentAnnotations | nindent 4 }} -{{- end }} - namespace: {{ .Release.Namespace }} + {{- if .Values.supersetNode.deploymentLabels }} + {{- toYaml .Values.supersetNode.deploymentLabels | nindent 4 }} + {{- end }} + {{- if .Values.supersetNode.deploymentAnnotations }} + annotations: {{- toYaml .Values.supersetNode.deploymentAnnotations | nindent 4 }} + {{- end }} spec: replicas: {{ .Values.supersetNode.replicaCount }} {{- if .Values.supersetNode.strategy }} - strategy: - {{- toYaml .Values.supersetNode.strategy | nindent 4 }} + strategy: {{- toYaml .Values.supersetNode.strategy | nindent 4 }} {{- end }} selector: matchLabels: @@ -58,27 +56,26 @@ spec: # Optionally force the thing to reload force-reload: {{ randAlphaNum 5 | quote }} {{- end }} - {{- if .Values.supersetNode.podAnnotations }} - {{- toYaml .Values.supersetNode.podAnnotations | nindent 8 }} - {{- end }} + {{- if .Values.supersetNode.podAnnotations }} + {{- 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 }} - {{- end }} + {{- if .Values.supersetNode.podLabels }} + {{- toYaml .Values.supersetNode.podLabels | nindent 8 }} + {{- end }} spec: {{- if or (.Values.serviceAccount.create) (.Values.serviceAccountName) }} serviceAccountName: {{ template "superset.serviceAccountName" . }} {{- end }} securityContext: runAsUser: {{ .Values.runAsUser }} - {{- if .Values.supersetNode.podSecurityContext }} - {{- toYaml .Values.supersetNode.podSecurityContext | nindent 8 }} - {{- end }} + {{- if .Values.supersetNode.podSecurityContext }} + {{- toYaml .Values.supersetNode.podSecurityContext | nindent 8 }} + {{- end }} {{- if .Values.supersetNode.initContainers }} - initContainers: - {{- tpl (toYaml .Values.supersetNode.initContainers) . | nindent 6 }} + initContainers: {{- tpl (toYaml .Values.supersetNode.initContainers) . | nindent 6 }} {{- end }} {{- with .Values.hostAliases }} hostAliases: {{- toYaml . | nindent 6 }} @@ -103,7 +100,7 @@ spec: value: {{ $value | quote }} {{- end }} {{- if .Values.extraEnvRaw }} - {{- toYaml .Values.extraEnvRaw | nindent 12 }} + {{- toYaml .Values.extraEnvRaw | nindent 12 }} {{- end }} envFrom: - secretRef: @@ -116,70 +113,63 @@ spec: - name: superset-config mountPath: {{ .Values.configMountPath | quote }} readOnly: true - {{- if .Values.extraConfigs }} + {{- if .Values.extraConfigs }} - name: superset-extra-config mountPath: {{ .Values.extraConfigMountPath | quote }} readOnly: true - {{- end }} - {{- with .Values.extraVolumeMounts }} - {{- tpl (toYaml .) $ | nindent 12 -}} - {{- end }} + {{- end }} + {{- with .Values.extraVolumeMounts }} + {{- tpl (toYaml .) $ | nindent 12 -}} + {{- end }} ports: - name: http containerPort: {{ .Values.service.port }} protocol: TCP {{- if .Values.supersetNode.startupProbe }} - startupProbe: - {{- .Values.supersetNode.startupProbe | toYaml | nindent 12 }} + startupProbe: {{- .Values.supersetNode.startupProbe | toYaml | nindent 12 }} {{- end }} {{- if .Values.supersetNode.readinessProbe }} - readinessProbe: - {{- .Values.supersetNode.readinessProbe | toYaml | nindent 12 }} + readinessProbe: {{- .Values.supersetNode.readinessProbe | toYaml | nindent 12 }} {{- end }} {{- if .Values.supersetNode.livenessProbe }} - livenessProbe: - {{- .Values.supersetNode.livenessProbe | toYaml | nindent 12 }} + livenessProbe: {{- .Values.supersetNode.livenessProbe | toYaml | nindent 12 }} {{- end }} resources: - {{- if .Values.supersetNode.resources }} - {{- toYaml .Values.supersetNode.resources | nindent 12 }} - {{- else }} - {{- toYaml .Values.resources | nindent 12 }} - {{- end }} -{{- if .Values.supersetNode.extraContainers }} -{{- toYaml .Values.supersetNode.extraContainers | nindent 8 }} -{{- end }} + {{- if .Values.supersetNode.resources }} + {{- toYaml .Values.supersetNode.resources | nindent 12 }} + {{- else }} + {{- toYaml .Values.resources | nindent 12 }} + {{- end }} + {{- if .Values.supersetNode.extraContainers }} + {{- toYaml .Values.supersetNode.extraContainers | nindent 8 }} + {{- end }} {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} + nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- if or .Values.affinity .Values.supersetNode.affinity }} affinity: {{- with .Values.affinity }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.supersetNode.affinity }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- end }} {{- if or .Values.topologySpreadConstraints .Values.supersetNode.topologySpreadConstraints }} topologySpreadConstraints: {{- with .Values.topologySpreadConstraints }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.supersetNode.topologySpreadConstraints }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- end }} {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} + tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml .Values.imagePullSecrets | nindent 8 }} + imagePullSecrets: {{- toYaml .Values.imagePullSecrets | nindent 8 }} {{- end }} - volumes: - name: superset-config secret: @@ -190,5 +180,5 @@ spec: name: {{ template "superset.fullname" . }}-extra-config {{- end }} {{- with .Values.extraVolumes }} - {{- tpl (toYaml .) $ | nindent 8 -}} + {{- tpl (toYaml .) $ | nindent 8 -}} {{- end }} diff --git a/helm/superset/templates/ingress.yaml b/helm/superset/templates/ingress.yaml index 44e1e48374..cec2562f78 100644 --- a/helm/superset/templates/ingress.yaml +++ b/helm/superset/templates/ingress.yaml @@ -20,32 +20,31 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $fullName }} + namespace: {{ .Release.Namespace }} labels: app: {{ template "superset.name" . }} chart: {{ template "superset.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} + annotations: {{- toYaml . | nindent 4 }} {{- end }} - namespace: {{ .Release.Namespace }} spec: -{{- if .Values.ingress.ingressClassName }} + {{- if .Values.ingress.ingressClassName }} ingressClassName: {{ .Values.ingress.ingressClassName }} -{{- end }} -{{- if .Values.ingress.tls }} + {{- end }} + {{- if .Values.ingress.tls }} tls: - {{- range .Values.ingress.tls }} + {{- range .Values.ingress.tls }} - hosts: {{- range .hosts }} - {{ . }} {{- end }} secretName: {{ .secretName }} + {{- end }} {{- end }} -{{- end }} rules: - {{- range .Values.ingress.hosts }} + {{- range .Values.ingress.hosts }} - host: {{ . }} http: paths: @@ -65,8 +64,8 @@ spec: port: name: ws {{- end }} - {{- end }} + {{- end }} {{- if .Values.ingress.extraHostsRaw }} - {{- toYaml .Values.ingress.extraHostsRaw | nindent 4 }} + {{- toYaml .Values.ingress.extraHostsRaw | nindent 4 }} {{- end }} {{- end }} diff --git a/helm/superset/templates/init-job.yaml b/helm/superset/templates/init-job.yaml index 1f4ba57ae5..e225600fef 100644 --- a/helm/superset/templates/init-job.yaml +++ b/helm/superset/templates/init-job.yaml @@ -19,19 +19,18 @@ apiVersion: batch/v1 kind: Job metadata: name: {{ template "superset.name" . }}-init-db + namespace: {{ .Release.Namespace }} {{- if .Values.init.helmHook }} annotations: "helm.sh/hook": post-install,post-upgrade "helm.sh/hook-delete-policy": "before-hook-creation" {{- end }} - namespace: {{ .Release.Namespace }} spec: template: metadata: name: {{ template "superset.name" . }}-init-db {{- if .Values.init.podAnnotations }} - annotations: - {{- toYaml .Values.init.podAnnotations | nindent 8 }} + annotations: {{- toYaml .Values.init.podAnnotations | nindent 8 }} {{- end }} spec: {{- if or (.Values.serviceAccount.create) (.Values.serviceAccountName) }} @@ -39,12 +38,11 @@ spec: {{- end }} securityContext: runAsUser: {{ .Values.runAsUser }} - {{- if .Values.init.podSecurityContext }} - {{- toYaml .Values.init.podSecurityContext | nindent 8 }} - {{- end }} + {{- if .Values.init.podSecurityContext }} + {{- toYaml .Values.init.podSecurityContext | nindent 8 }} + {{- end }} {{- if .Values.init.initContainers }} - initContainers: - {{- tpl (toYaml .Values.init.initContainers) . | nindent 6 }} + initContainers: {{- tpl (toYaml .Values.init.initContainers) . | nindent 6 }} {{- end }} containers: - name: {{ template "superset.name" . }}-init-db @@ -56,7 +54,7 @@ spec: value: {{ $value | quote }} {{- end }} {{- if .Values.extraEnvRaw }} - {{- toYaml .Values.extraEnvRaw | nindent 10 }} + {{- toYaml .Values.extraEnvRaw | nindent 10 }} {{- end }} {{- end }} envFrom: @@ -74,46 +72,42 @@ spec: - name: superset-config mountPath: {{ .Values.configMountPath | quote }} readOnly: true - {{- if .Values.extraConfigs }} + {{- if .Values.extraConfigs }} - name: superset-extra-config mountPath: {{ .Values.extraConfigMountPath | quote }} readOnly: true - {{- end }} - {{- with .Values.extraVolumeMounts }} - {{- tpl (toYaml .) $ | nindent 10 -}} - {{- end }} + {{- end }} + {{- with .Values.extraVolumeMounts }} + {{- tpl (toYaml .) $ | nindent 10 -}} + {{- end }} command: {{ tpl (toJson .Values.init.command) . }} - resources: - {{- toYaml .Values.init.resources | nindent 10 }} + resources: {{- toYaml .Values.init.resources | nindent 10 }} {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} + nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- if or .Values.affinity .Values.init.affinity }} affinity: {{- with .Values.affinity }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.init.affinity }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- end }} {{- if or .Values.topologySpreadConstraints .Values.init.topologySpreadConstraints }} topologySpreadConstraints: {{- with .Values.topologySpreadConstraints }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.init.topologySpreadConstraints }} - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- end }} {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} + tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml .Values.imagePullSecrets | nindent 8 }} + imagePullSecrets: {{- toYaml .Values.imagePullSecrets | nindent 8 }} {{- end }} volumes: - name: superset-config @@ -125,7 +119,7 @@ spec: name: {{ template "superset.fullname" . }}-extra-config {{- end }} {{- with .Values.extraVolumes }} - {{- tpl (toYaml .) $ | nindent 8 -}} + {{- tpl (toYaml .) $ | nindent 8 -}} {{- end }} restartPolicy: Never {{- end }} diff --git a/helm/superset/templates/secret-env.yaml b/helm/superset/templates/secret-env.yaml index 0164d96a8c..41fac42bda 100644 --- a/helm/superset/templates/secret-env.yaml +++ b/helm/superset/templates/secret-env.yaml @@ -18,12 +18,12 @@ apiVersion: v1 kind: Secret metadata: name: {{ template "superset.fullname" . }}-env + namespace: {{ .Release.Namespace }} labels: app: {{ template "superset.fullname" . }} chart: {{ template "superset.chart" . }} release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" - namespace: {{ .Release.Namespace }} type: Opaque stringData: REDIS_HOST: {{ tpl .Values.supersetNode.connections.redis_host . | quote }} diff --git a/helm/superset/templates/secret-superset-config.yaml b/helm/superset/templates/secret-superset-config.yaml index c1f4102858..165d00356b 100644 --- a/helm/superset/templates/secret-superset-config.yaml +++ b/helm/superset/templates/secret-superset-config.yaml @@ -18,24 +18,24 @@ apiVersion: v1 kind: Secret metadata: name: {{ template "superset.fullname" . }}-config + namespace: {{ .Release.Namespace }} labels: app: {{ template "superset.fullname" . }} chart: {{ template "superset.chart" . }} release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" - namespace: {{ .Release.Namespace }} type: Opaque stringData: superset_config.py: | -{{- include "superset-config" . | nindent 4 }} + {{- include "superset-config" . | nindent 4 }} superset_init.sh: | -{{- tpl .Values.init.initscript . | nindent 4 }} + {{- tpl .Values.init.initscript . | nindent 4 }} superset_bootstrap.sh: | -{{- tpl .Values.bootstrapScript . | nindent 4 }} + {{- tpl .Values.bootstrapScript . | nindent 4 }} -{{- if .Values.extraSecrets }} -{{- range $path, $config := .Values.extraSecrets }} + {{- if .Values.extraSecrets }} + {{- range $path, $config := .Values.extraSecrets }} {{ $path }}: | -{{- tpl $config $ | nindent 4 -}} -{{- end -}} -{{- end -}} + {{- tpl $config $ | nindent 4 -}} + {{- end -}} + {{- end -}} diff --git a/helm/superset/templates/secret-ws.yaml b/helm/superset/templates/secret-ws.yaml index c3ac55d96c..27f15b7841 100644 --- a/helm/superset/templates/secret-ws.yaml +++ b/helm/superset/templates/secret-ws.yaml @@ -19,14 +19,14 @@ apiVersion: v1 kind: Secret metadata: name: "{{ template "superset.fullname" . }}-ws-config" + namespace: {{ .Release.Namespace }} labels: app: {{ template "superset.fullname" . }} chart: {{ template "superset.chart" . }} release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" - namespace: {{ .Release.Namespace }} type: Opaque stringData: - config.json: | - {{- tpl (toJson .Values.supersetWebsockets.config) . | nindent 6 }} + config.json: | + {{- tpl (toJson .Values.supersetWebsockets.config) . | nindent 4 }} {{- end }} diff --git a/helm/superset/templates/service-account.yaml b/helm/superset/templates/service-account.yaml index 994ad8333a..fb8a16d4d8 100755 --- a/helm/superset/templates/service-account.yaml +++ b/helm/superset/templates/service-account.yaml @@ -19,6 +19,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "superset.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} labels: app.kubernetes.io/name: {{ include "superset.name" . }} helm.sh/chart: {{ include "superset.chart" . }} @@ -31,5 +32,4 @@ metadata: {{- if .Values.serviceAccount.annotations }} annotations: {{- toYaml .Values.serviceAccount.annotations | nindent 4 }} {{- end }} - namespace: {{ .Release.Namespace }} {{- end -}} diff --git a/helm/superset/templates/service.yaml b/helm/superset/templates/service.yaml index 97db594a23..5850e5732b 100644 --- a/helm/superset/templates/service.yaml +++ b/helm/superset/templates/service.yaml @@ -18,16 +18,15 @@ apiVersion: v1 kind: Service metadata: name: {{ template "superset.fullname" . }} + namespace: {{ .Release.Namespace }} labels: app: {{ template "superset.name" . }} chart: {{ template "superset.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} -{{- with .Values.service.annotations }} - annotations: -{{- toYaml . | nindent 4 }} -{{- end }} - namespace: {{ .Release.Namespace }} + {{- with .Values.service.annotations }} + annotations: {{- toYaml . | nindent 4 }} + {{- end }} spec: type: {{ .Values.service.type }} ports: @@ -50,16 +49,15 @@ apiVersion: v1 kind: Service metadata: name: "{{ template "superset.fullname" . }}-flower" + namespace: {{ .Release.Namespace }} labels: app: {{ template "superset.name" . }} chart: {{ template "superset.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} {{- with .Values.supersetCeleryFlower.service.annotations }} - annotations: - {{- toYaml . | nindent 4 }} + annotations: {{- toYaml . | nindent 4 }} {{- end }} - namespace: {{ .Release.Namespace }} spec: type: {{ .Values.supersetCeleryFlower.service.type }} ports: @@ -83,16 +81,15 @@ apiVersion: v1 kind: Service metadata: name: "{{ template "superset.fullname" . }}-ws" + namespace: {{ .Release.Namespace }} labels: app: {{ template "superset.name" . }} chart: {{ template "superset.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} {{- with .Values.supersetWebsockets.service.annotations }} - annotations: - {{- toYaml . | nindent 4 }} + annotations: {{- toYaml . | nindent 4 }} {{- end }} - namespace: {{ .Release.Namespace }} spec: type: {{ .Values.supersetWebsockets.service.type }} ports: diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml index b04dc66934..3398332379 100644 --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -50,8 +50,7 @@ envFromSecret: '{{ template "superset.fullname" . }}-env' envFromSecrets: [] # -- Extra environment variables that will be passed into pods -extraEnv: - {} +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 @@ -74,8 +73,7 @@ extraEnv: # OAUTH_WHITELIST_REGEX: ... # -- Extra environment variables in RAW format that will be passed into pods -extraEnvRaw: - [] +extraEnvRaw: [] # Load DB password from other secret (e.g. for zalando operator) # - name: DB_PASS # valueFrom: @@ -84,16 +82,14 @@ extraEnvRaw: # key: password # -- Extra environment variables to pass as secrets -extraSecretEnv: - {} +extraSecretEnv: {} # MAPBOX_API_KEY: ... # # Google API Keys: https://console.cloud.google.com/apis/credentials # GOOGLE_KEY: ... # GOOGLE_SECRET: ... # -- Extra files to mount on `/app/pythonpath` -extraConfigs: - {} +extraConfigs: {} # import_datasources.yaml: | # databases: # - allow_file_upload: true @@ -109,8 +105,7 @@ extraConfigs: # -- Extra files to mount on `/app/pythonpath` as secrets extraSecrets: {} -extraVolumes: - [] +extraVolumes: [] # - name: customConfig # configMap: # name: '{{ template "superset.fullname" . }}-custom-config' @@ -119,8 +114,7 @@ extraVolumes: # secretName: my-secret # defaultMode: 0600 -extraVolumeMounts: - [] +extraVolumeMounts: [] # - name: customConfig # mountPath: /mnt/config # readOnly: true @@ -130,8 +124,7 @@ extraVolumeMounts: # -- 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 -configOverrides: - {} +configOverrides: {} # extend_timeout: | # # Extend timeout to allow long running queries. # SUPERSET_WEBSERVER_TIMEOUT = ... @@ -168,8 +161,7 @@ configOverrides: # SECRET_KEY = 'YOUR_OWN_RANDOM_GENERATED_SECRET_KEY' # -- Same as above but the values are files -configOverridesFiles: - {} +configOverridesFiles: {} # extend_timeout: extend_timeout.py # enable_oauth: enable_oauth.py @@ -203,8 +195,7 @@ service: 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" @@ -220,8 +211,7 @@ 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 @@ -321,8 +311,7 @@ supersetNode: periodSeconds: 15 successThreshold: 1 # -- Resource settings for the supersetNode pods - these settings overwrite might existing values from the global resources object defined above. - resources: - {} + resources: {} # limits: # cpu: 100m # memory: 128Mi @@ -331,8 +320,7 @@ supersetNode: # memory: 128Mi podSecurityContext: {} containerSecurityContext: {} - strategy: - {} + strategy: {} # type: RollingUpdate # rollingUpdate: # maxSurge: 25% @@ -373,8 +361,7 @@ supersetWorker: # -- 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: - {} + resources: {} # limits: # cpu: 100m # memory: 128Mi @@ -383,8 +370,7 @@ supersetWorker: # memory: 128Mi podSecurityContext: {} containerSecurityContext: {} - strategy: - {} + strategy: {} # type: RollingUpdate # rollingUpdate: # maxSurge: 25% @@ -443,8 +429,7 @@ supersetCeleryBeat: # -- 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: - {} + resources: {} # limits: # cpu: 100m # memory: 128Mi @@ -524,8 +509,7 @@ supersetCeleryFlower: # -- Labels to be added to supersetCeleryFlower pods podLabels: {} # -- Resource settings for the CeleryBeat pods - these settings overwrite might existing values from the global resources object defined above. - resources: - {} + resources: {} # limits: # cpu: 100m # memory: 128Mi @@ -623,8 +607,7 @@ init: # 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: