diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f39cc1..7d852b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,13 +8,13 @@ jobs: strategy: matrix: k8s: - - v1.26.13 - - v1.27.10 - - v1.28.6 - - v1.29.1 + - v1.26 + - v1.27 + - v1.28 + - v1.29 runs-on: ubuntu-22.04 steps: - - uses: medyagh/setup-minikube@v0.0.14 + - uses: medyagh/setup-minikube@v0.0.16 with: kubernetes-version: ${{ matrix.k8s }} - uses: actions/checkout@v4 diff --git a/Chart.yaml b/Chart.yaml index 5c6d433..89f440c 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: redash -version: 3.0.1 -appVersion: 10.1.0.b50633 +version: 3.1.0-alpha1 +appVersion: 24.04.0-dev-b8640593524.10 description: Redash is an open source tool built for teams to query, visualize and collaborate. keywords: - redash diff --git a/requirements.lock b/requirements.lock index 6ec06ce..e9564ac 100644 --- a/requirements.lock +++ b/requirements.lock @@ -1,9 +1,9 @@ dependencies: - name: redis repository: oci://registry-1.docker.io/bitnamicharts - version: 18.19.4 + version: 19.1.0 - name: postgresql repository: oci://registry-1.docker.io/bitnamicharts - version: 13.4.6 -digest: sha256:bf1381bd95e1b7b7b93fc6e69ebc9c40c46ac7d39e6cbfa148e626b17f4d319c -generated: "2024-03-27T00:08:04.068636333+02:00" + version: 15.2.5 +digest: sha256:737414ecea2a8b28eb5170ec23dcc35251a77836e71283623d29874c4404159c +generated: "2024-04-11T10:04:30.905003+03:00" diff --git a/requirements.yaml b/requirements.yaml index ef82f46..fae458e 100644 --- a/requirements.yaml +++ b/requirements.yaml @@ -1,9 +1,9 @@ dependencies: - name: redis - version: "^18.9.0" + version: "^19.1.0" repository: oci://registry-1.docker.io/bitnamicharts condition: redis.enabled - name: postgresql - version: "^13.4.1" + version: "^15.2.0" repository: oci://registry-1.docker.io/bitnamicharts condition: postgresql.enabled diff --git a/scripts/update-env-config.py b/scripts/update-env-config.py deleted file mode 100644 index acf08da..0000000 --- a/scripts/update-env-config.py +++ /dev/null @@ -1,169 +0,0 @@ -import urllib.request -import re - - -def upper_repl(match): - return match.group(1).upper() - - -vars = [] -# Add some undocumented/operational values -vars.append( - { - "name": "secretKey", - "env": "REDASH_SECRET_KEY", - "desc": "Secret key used for data encryption", - "default": "", - "secret": True, - "required": True, - } -) -# Can remove once documented: https://github.com/getredash/website/issues/528 -vars.append( - { - "name": "samlSchemeOverride", - "env": "REDASH_SAML_SCHEME_OVERRIDE", - "desc": "This setting will allow you to override the SAML Auth URL scheme that gets constructed by Flask. This is a useful feature if, for example, you're behind a Proxy Protocol enabled TCP load balancer (AWS ELB that terminates SSL) and your Nginx proxy or similar adds a X-Forwarded-Proto of HTTP even though your Redash URL for SAML auth is HTTPS.", - "default": "", - "secret": False, - "required": False, - } -) -# Parse the docs and build a list of environment variables -with urllib.request.urlopen( - "https://raw.githubusercontent.com/getredash/website/master/src/pages/kb/open-source/admin-guide/env-vars-settings.md" -) as response: - data = response.read().decode("utf-8") - for line in data.splitlines(): - m = re.match(r"^\s*[|]\s*[`](REDASH_.+)[`]\s*[|]\s([^|]*)\s*[|]\s([^|]*)", line) - if m: - name = env = m.group(1).strip() - desc = m.group(2).strip() - default = m.group(3).strip() - if env in ["REDASH_REDIS_URL", "REDASH_DATABASE_URL"]: - continue - secret = False - if env in [ - "REDASH_LDAP_BIND_DN_PASSWORD", - "REDASH_MAIL_PASSWORD", - "REDASH_GOOGLE_CLIENT_SECRET", - "REDASH_COOKIE_SECRET", - "REDASH_SECRET_KEY", - ]: - secret = True - required = False - if env in ["REDASH_COOKIE_SECRET", "REDASH_SECRET_KEY"]: - required = True - # Unset default to make this clear - default = "" - name = re.sub(r"REDASH_", "", name).lower() - name = re.sub(r"_([a-z])", upper_repl, name) - vars.append( - { - "name": name, - "env": env, - "desc": desc, - "default": default, - "secret": secret, - "required": required, - } - ) - -# Replace lines between markers with config based on the docs -start_token = "## Start primary Redash configuration" -end_token = "## End primary Redash configuration" - -print("values.yaml snippet") -print() -config = [start_token] -config.append( - " ## Note that we document the Redash defaults, but don't explicitly set them." -) -config.append( - " ## This allows multiple versions of Redash (which may have different defaults) to be more easily used" -) -for var in vars: - required = "" - if var["required"]: - required = "REQUIRED " - comment = " # -- %s`%s` value." % ( - required, - var["env"], - ) - if len(var["desc"]) > 0: - comment += " %s." % (var["desc"].capitalize()) - if var["secret"]: - comment += " Stored as a Secret value." - if len(var["default"]) > 0: - comment += "\n # @default -- %s" % (var["default"]) - config.append(comment) - config.append(' %s: ""' % (var["name"])) -config.append(" ## End primary Redash configuration") - -values = open("values.yaml", "r+") -content = re.sub( - start_token + ".*" + end_token, "\n".join(config), values.read(), flags=re.DOTALL -) -values.seek(0) -values.truncate() -values.write(content) -values.close() - -print("secrets.yaml snippet") -print() -config = [start_token] -for var in vars: - required = 'default "" ' - if var["required"]: - config.append( - ' {{ $null := required "A value for one of the following variables is required: redash.%s (secure random value), redash.existingSecret (secret name)" (or .Values.redash.%s .Values.redash.existingSecret) }}' - % (var["name"], var["name"]) - ) - if var["secret"]: - config.append( - ' %s: {{ default "" .Values.redash.%s | b64enc | quote }}' - % (var["name"], var["name"]) - ) -config.append(" ## End primary Redash configuration") - -secrets = open("templates/secrets.yaml", "r+") -content = re.sub( - start_token + ".*" + end_token, "\n".join(config), secrets.read(), flags=re.DOTALL -) -secrets.seek(0) -secrets.truncate() -secrets.write(content) -secrets.close() - -print("_helpers.tpl snippet") -print() - -config = [start_token] -for var in vars: - if var["secret"]: - config.append( - "{{- if or .Values.redash.%s .Values.redash.existingSecret }}" - % (var["name"]) - ) - config.append("- name: %s" % (var["env"])) - config.append(" valueFrom:") - config.append(" secretKeyRef:") - config.append(' name: {{ include "redash.secretName" . }}') - config.append(" key: %s" % (var["name"])) - else: - config.append("{{- if .Values.redash.%s }}" % (var["name"])) - config.append("- name: %s" % (var["env"])) - config.append( - " value: {{ default " " .Values.redash.%s | quote }}" % (var["name"]) - ) - config.append("{{- end }}") -config.append("## End primary Redash configuration") - -secrets = open("templates/_helpers.tpl", "r+") -content = re.sub( - start_token + ".*" + end_token, "\n".join(config), secrets.read(), flags=re.DOTALL -) -secrets.seek(0) -secrets.truncate() -secrets.write(content) -secrets.close() diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 23e0e4f..8f27cb5 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -85,7 +85,7 @@ Shared environment block used across each component. {{ else -}} value: {{ default "" .Values.externalPostgreSQL | quote }} {{- end }} -{{ else -}} +{{- else -}} - name: REDASH_DATABASE_USER value: "{{ .Values.postgresql.auth.username }}" - name: REDASH_DATABASE_PASSWORD @@ -97,7 +97,7 @@ Shared environment block used across each component. value: {{ include "redash.postgresql.fullname" . }} - name: REDASH_DATABASE_PORT value: "{{ .Values.postgresql.primary.service.ports.postgresql }}" -- name: REDASH_DATABASE_DB +- name: REDASH_DATABASE_NAME value: "{{ .Values.postgresql.auth.database }}" {{- end }} {{- if not .Values.redis.enabled }} @@ -123,7 +123,7 @@ Shared environment block used across each component. value: {{ include "redash.redis.fullname" . }} - name: REDASH_REDIS_PORT value: "{{ .Values.redis.master.service.ports.redis }}" -- name: REDASH_REDIS_DB +- name: REDASH_REDIS_NAME value: "{{ .Values.redis.database }}" {{- end }} {{- end }} diff --git a/templates/configmap.yaml b/templates/configmap.yaml deleted file mode 100644 index 7007fd2..0000000 --- a/templates/configmap.yaml +++ /dev/null @@ -1,84 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "redash.fullname" . }} - labels: - {{- include "redash.labels" . | nindent 4 }} -data: - install-upgrade.sh: | - #!/usr/bin/env bash - echo "This will retry connections until PostgreSQL/Redis is up, then perform database installation/migrations as needed." - - # Status command timeout - STATUS_TIMEOUT=45 - # Create tables command timeout - CREATE_TIMEOUT=60 - # Upgrade command timeout - UPGRADE_TIMEOUT=600 - # Time to wait between attempts - RETRY_WAIT=10 - # Max number of attempts - MAX_ATTEMPTS=5 - - # Load connection variables - . /config/dynamicenv.sh - - # Check Settings (for debug) - # /app/manage.py check_settings - - # Initialize attempt counter - ATTEMPTS=0 - while ((ATTEMPTS < MAX_ATTEMPTS)); do - echo "Starting attempt ${ATTEMPTS} of ${MAX_ATTEMPTS}" - ATTEMPTS=$((ATTEMPTS+1)) - - # Install and upgrade - echo "Installing Redash:" - timeout $CREATE_TIMEOUT /app/manage.py database create_tables - echo "Tables created" - echo "Running Redash database migrations after install" - timeout $UPGRADE_TIMEOUT /app/manage.py db upgrade - echo "Upgrade complete" - - STATUS=$(timeout $STATUS_TIMEOUT /app/manage.py status 2>&1) - RETCODE=$? - echo "Return code: ${RETCODE}" - echo "Status: ${STATUS}" - case "$RETCODE" in - 0) - exit 0 - ;; - 124) - echo "Status command timed out after ${STATUS_TIMEOUT} seconds." - ;; - esac - case "$STATUS" in - *sqlalchemy.exc.OperationalError*) - echo "Database not yet functional, waiting." - ;; - *sqlalchemy.exc.ProgrammingError*) - echo "Database does not appear to be installed." - ;; - esac - echo "Waiting ${RETRY_WAIT} seconds before retrying." - sleep 10 - done - echo "Reached ${MAX_ATTEMPTS} attempts, giving up." - exit 1 - dynamicenv.sh: | - # Build connection URLs from environment variables. - # NOTES: - # This script should be sourced, not run directly. - # All variables are expected to be set by the caller. - if [ -z "$REDASH_DATABASE_URL" ]; then - export REDASH_DATABASE_URL=postgresql://${REDASH_DATABASE_USER}:${REDASH_DATABASE_PASSWORD}@${REDASH_DATABASE_HOSTNAME}:${REDASH_DATABASE_PORT}/${REDASH_DATABASE_DB} - echo "Using Database: postgresql://${REDASH_DATABASE_USER}:******@${REDASH_DATABASE_HOSTNAME}:${REDASH_DATABASE_PORT}/${REDASH_DATABASE_DB}" - else - echo "Using external postgresql database" - fi - if [ -z "$REDASH_REDIS_URL" ]; then - export REDASH_REDIS_URL=redis://:${REDASH_REDIS_PASSWORD}@${REDASH_REDIS_HOSTNAME}:${REDASH_REDIS_PORT}/${REDASH_REDIS_DB} - echo "Using Redis: redis://:******@${REDASH_REDIS_HOSTNAME}:${REDASH_REDIS_PORT}/${REDASH_REDIS_DB}" - else - echo "Using external redis database" - fi diff --git a/templates/hook-migrations-job.yaml b/templates/hook-migrations-job.yaml index 9528e14..8b396ab 100644 --- a/templates/hook-migrations-job.yaml +++ b/templates/hook-migrations-job.yaml @@ -15,31 +15,24 @@ spec: template: metadata: name: "{{ .Release.Name }}" - labels: - {{- include "redash.selectorLabels" . | nindent 8 }} - {{- if .Values.migrations.podAnnotations }} - annotations: - {{ toYaml .Values.migrations.podAnnotations | nindent 8 }} + labels: {{ include "redash.selectorLabels" . | nindent 8 }} + {{- with .Values.migrations.podAnnotations }} + annotations: {{ toYaml . | nindent 8 }} {{- end }} spec: {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} + imagePullSecrets: {{ toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "redash.serviceAccountName" . }} restartPolicy: Never - securityContext: - {{- toYaml .Values.migrations.podSecurityContext | nindent 8 }} + securityContext: {{ toYaml .Values.migrations.podSecurityContext | nindent 8 }} containers: - name: {{ include "redash.name" . }}-server - securityContext: - {{- toYaml .Values.migrations.securityContext | nindent 10 }} - image: {{ .Values.image.registry }}/{{ .Values.image.repo }}:{{ .Values.image.tag }} + securityContext: {{ toYaml .Values.migrations.securityContext | nindent 10 }} + image: "{{ .Values.image.registry }}/{{ .Values.image.repo }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - command: ["/bin/bash", "/config/install-upgrade.sh"] - volumeMounts: - - name: config - mountPath: /config + args: + - create_db env: {{- include "redash.env" . | nindent 10 }} {{- range $key, $value := .Values.migrations.env }} @@ -50,13 +43,15 @@ spec: envFrom: {{- include "redash.envFrom" . | nindent 10 }} {{- end}} - {{- if (.Values.migrations.resources) }} - resources: {{ toYaml .Values.migrations.resources | nindent 10 }} + {{- with .Values.migrations.resources }} + resources: {{ toYaml . | nindent 10 }} {{- end }} - volumes: - - name: config - configMap: - name: {{ include "redash.fullname" . }} + {{- with .Values.migrations.volumeMounts }} + volumeMounts: {{ toYaml . | nindent 10 }} + {{- end }} + {{- with .Values.migrations.volumes }} + volumes: {{ toYaml . | nindent 8 }} + {{- end }} {{- with .Values.migrations.nodeSelector }} nodeSelector: {{ toYaml . | nindent 8 }} {{- end }} diff --git a/templates/scheduler-deployment.yaml b/templates/scheduler-deployment.yaml index ba91302..1d99b4a 100644 --- a/templates/scheduler-deployment.yaml +++ b/templates/scheduler-deployment.yaml @@ -18,65 +18,51 @@ spec: labels: {{- include "redash.selectorLabels" . | nindent 8 }} app.kubernetes.io/component: scheduler - {{- if .Values.scheduler.podLabels }} - {{- tpl (toYaml .Values.scheduler.podLabels) $ | nindent 8 }} + {{- with .Values.scheduler.podLabels }} + {{- tpl (toYaml .) $ | nindent 8 }} {{- end }} {{- if .Values.scheduler.podAnnotations }} - annotations: - {{ toYaml .Values.scheduler.podAnnotations | nindent 8 }} + annotations: {{ toYaml .Values.scheduler.podAnnotations | nindent 8 }} {{- end }} spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} + {{ with .Values.imagePullSecrets -}} + imagePullSecrets: {{ toYaml . | nindent 8 }} + {{ end -}} serviceAccountName: {{ include "redash.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.scheduler.podSecurityContext | nindent 8 }} + securityContext: {{ toYaml .Values.scheduler.podSecurityContext | nindent 8 }} containers: {{- with .Values.scheduler.extraContainers -}} - {{- toYaml . | nindent 8 }} + {{ toYaml . | nindent 8 }} {{- end }} - name: {{ include "redash.name" . }}-scheduler - securityContext: - {{- toYaml .Values.scheduler.securityContext | nindent 12 }} - image: {{ .Values.image.registry }}/{{ .Values.image.repo }}:{{ .Values.image.tag }} + securityContext: {{ toYaml .Values.scheduler.securityContext | nindent 12 }} + image: {{ .Values.image.registry }}/{{ .Values.image.repo }}:{{ .Values.image.tag | default .Chart.AppVersion }} imagePullPolicy: {{ .Values.image.pullPolicy }} - command: ["/bin/sh"] - args: ["-c", ". /config/dynamicenv.sh && /app/bin/docker-entrypoint scheduler"] - volumeMounts: - - name: config - mountPath: /config - {{- with .Values.scheduler.volumeMounts }} - {{- toYaml . | nindent 12 }} - {{- end }} + {{- with .Values.scheduler.volumeMounts }} + volumeMounts: {{ toYaml . | nindent 12 }} + {{- end }} + args: + - scheduler env: {{- include "redash.env" . | nindent 12 }} {{- range $key, $value := .Values.scheduler.env }} - name: "{{ $key }}" value: "{{ $value }}" {{- end }} - {{- if (include "redash.envFrom" .) }} - envFrom: - {{- include "redash.envFrom" . | nindent 12 }} + {{- with (include "redash.envFrom" .) }} + envFrom: {{ . | nindent 12 }} {{- end }} - {{- if .Values.scheduler.resources }} - resources: {{ toYaml .Values.scheduler.resources | nindent 12 }} + {{- with .Values.scheduler.resources }} + resources: {{ toYaml . | nindent 12 }} {{- end }} - volumes: - - name: config - configMap: - name: {{ include "redash.fullname" . }} - {{- with .Values.scheduler.volumes }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- if .Values.scheduler.nodeSelector }} - nodeSelector: - {{ toYaml .Values.scheduler.nodeSelector | nindent 8 }} + {{- with .Values.scheduler.volumes }} + volumes: {{ toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.scheduler.nodeSelector }} + nodeSelector: {{ toYaml . | nindent 8 }} {{- end }} {{- with .Values.scheduler.affinity }} - affinity: - {{ toYaml . | nindent 8 }} + affinity: {{ toYaml . | nindent 8 }} {{- end }} {{- with .Values.scheduler.tolerations }} tolerations: diff --git a/templates/server-deployment.yaml b/templates/server-deployment.yaml index 2f1b3c6..2fd6901 100644 --- a/templates/server-deployment.yaml +++ b/templates/server-deployment.yaml @@ -19,44 +19,36 @@ spec: {{- if .Values.server.podLabels }} {{- tpl (toYaml .Values.server.podLabels) $ | nindent 8 }} {{- end }} - {{- if .Values.server.podAnnotations }} - annotations: - {{ toYaml .Values.server.podAnnotations | nindent 8 }} + {{- with .Values.server.podAnnotations }} + annotations: {{ toYaml . | nindent 8 }} {{- end }} spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} + {{ with .Values.imagePullSecrets -}} + imagePullSecrets: {{ toYaml . | nindent 8 }} + {{ end -}} serviceAccountName: {{ include "redash.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.server.podSecurityContext | nindent 8 }} + securityContext: {{ toYaml .Values.server.podSecurityContext | nindent 8 }} containers: {{- with .Values.server.extraContainers -}} {{- toYaml . | nindent 8 }} {{- end }} - name: {{ include "redash.name" . }}-server - securityContext: - {{- toYaml .Values.server.securityContext | nindent 12 }} - image: {{ .Values.image.registry }}/{{ .Values.image.repo }}:{{ .Values.image.tag }} + securityContext: {{ toYaml .Values.server.securityContext | nindent 12 }} + image: {{ .Values.image.registry }}/{{ .Values.image.repo }}:{{ .Values.image.tag | default .Chart.AppVersion }} imagePullPolicy: {{ .Values.image.pullPolicy }} - command: ["/bin/sh"] - args: ["-c", ". /config/dynamicenv.sh && /app/bin/docker-entrypoint server"] - volumeMounts: - - name: config - mountPath: /config - {{- with .Values.server.volumeMounts }} - {{- toYaml . | nindent 12 }} - {{- end }} + {{- with .Values.server.volumeMounts }} + volumeMounts: {{ toYaml . | nindent 12 }} + {{- end }} + args: + - server env: {{- include "redash.env" . | nindent 12 }} {{- range $key, $value := .Values.server.env }} - name: "{{ $key }}" value: "{{ $value }}" {{- end }} - {{- if (include "redash.envFrom" .) }} - envFrom: - {{- include "redash.envFrom" . | nindent 12 }} + {{ with (include "redash.envFrom" .) -}} + envFrom: {{ . | nindent 12 }} {{- end }} ports: - containerPort: {{ .Values.server.httpPort }} @@ -79,24 +71,18 @@ spec: periodSeconds: 10 successThreshold: 1 failureThreshold: 3 - {{- if .Values.server.resources }} + {{- with .Values.server.resources }} resources: {{ toYaml .Values.server.resources | nindent 12 }} {{- end }} - volumes: - - name: config - configMap: - name: {{ include "redash.fullname" . }} - {{- with .Values.server.volumes }} - {{- toYaml . | nindent 8 }} - {{- end }} + {{- with .Values.server.volumes }} + volumes: {{ toYaml . | nindent 8 }} + {{- end }} {{- with .Values.server.nodeSelector }} nodeSelector: {{ toYaml . | nindent 8 }} {{- end }} {{- with .Values.server.affinity }} - affinity: - {{ toYaml . | nindent 8 }} + affinity: {{ toYaml . | nindent 8 }} {{- end }} {{- with .Values.server.tolerations }} - tolerations: - {{ toYaml . | nindent 8 }} + tolerations: {{ toYaml . | nindent 8 }} {{- end }} diff --git a/templates/worker-deployment.yaml b/templates/worker-deployment.yaml index 7f3a5ac..5055f31 100644 --- a/templates/worker-deployment.yaml +++ b/templates/worker-deployment.yaml @@ -6,49 +6,39 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "redash.worker.fullname" $context }} - labels: - {{- include "redash.labels" $context | nindent 4 }} + labels: {{ include "redash.labels" $context | nindent 4 }} spec: replicas: {{ $workerConfig.replicaCount }} selector: - matchLabels: - {{- include "redash.selectorLabels" $context | nindent 6 }} + matchLabels: {{ include "redash.selectorLabels" $context | nindent 6 }} template: metadata: - labels: - {{- include "redash.selectorLabels" $context | nindent 8 }} - {{- if $workerConfig.podLabels }} - {{- tpl (toYaml $workerConfig.podLabels) $ | nindent 8 }} - {{- end }} - {{- if $workerConfig.podAnnotations }} - annotations: - {{ toYaml $workerConfig.podAnnotations | nindent 8 }} + labels: {{ include "redash.selectorLabels" $context | nindent 8 }} + {{- if $workerConfig.podLabels }} + {{ tpl (toYaml $workerConfig.podLabels) $ | nindent 8 }} + {{- end }} + {{- with $workerConfig.podAnnotations -}} + annotations: {{ toYaml . | nindent 8 }} {{- end }} spec: - {{- with $.Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} + {{ with $.Values.imagePullSecrets -}} + imagePullSecrets: {{ toYaml . | nindent 8 }} + {{- end -}} serviceAccountName: {{ include "redash.serviceAccountName" $context }} - securityContext: - {{- toYaml $workerConfig.podSecurityContext | nindent 8 }} + securityContext: {{ toYaml $workerConfig.podSecurityContext | nindent 8 }} containers: {{- with $workerConfig.extraContainers -}} {{- toYaml . | nindent 8 }} {{- end }} - name: {{ include "redash.name" $context }}-{{ $workerName }}worker - securityContext: - {{- toYaml $workerConfig.securityContext | nindent 12 }} - image: {{ $.Values.image.registry }}/{{ $.Values.image.repo }}:{{ $.Values.image.tag }} + securityContext: {{ toYaml $workerConfig.securityContext | nindent 12 }} + image: {{ $.Values.image.registry }}/{{ $.Values.image.repo }}:{{ $.Values.image.tag | default $.Chart.AppVersion }} imagePullPolicy: {{ $.Values.image.pullPolicy }} - command: ["/bin/sh"] - args: ["-c", ". /config/dynamicenv.sh && /app/bin/docker-entrypoint worker"] - volumeMounts: - - name: config - mountPath: /config - {{- with $workerConfig.volumeMounts }} - {{- toYaml . | nindent 12 }} - {{- end }} + args: + - worker + {{ with $workerConfig.volumeMounts -}} + volumeMounts: {{ toYaml . | nindent 12 }} + {{- end -}} livenessProbe: {{ toYaml $workerConfig.livenessProbe | nindent 12 }} env: {{- include "redash.env" $ | nindent 12 }} @@ -56,22 +46,17 @@ spec: - name: "{{ $key }}" value: "{{ $value }}" {{- end }} - {{ if (include "redash.envFrom" $) }} - envFrom: - {{- include "redash.envFrom" $ | nindent 12 }} + {{- with (include "redash.envFrom" $) }} + envFrom: {{ . | nindent 12 }} {{- end }} - {{- if $workerConfig.resources }} - resources: {{ toYaml $workerConfig.resources | nindent 12 }} + {{- with $workerConfig.resources }} + resources: {{ toYaml . | nindent 12 }} {{- end }} - volumes: - - name: config - configMap: - name: {{ include "redash.fullname" $context }} - {{- with $workerConfig.volumes }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- if $workerConfig.nodeSelector }} - nodeSelector: {{ toYaml $workerConfig.nodeSelector | nindent 8 }} + {{- with $workerConfig.volumes }} + volumes: {{ toYaml . | nindent 8 }} + {{- end }} + {{- with $workerConfig.nodeSelector }} + nodeSelector: {{ toYaml . | nindent 8 }} {{- end }} {{- with $workerConfig.affinity }} affinity: {{ toYaml . | nindent 8 }} diff --git a/values.yaml b/values.yaml index c8d0c64..3522d27 100644 --- a/values.yaml +++ b/values.yaml @@ -3,9 +3,9 @@ image: registry: docker.io # image.repo -- Redash image name used for server and worker pods - repo: redash/redash + repo: redash/preview # image.tag -- Redash image [tag](https://hub.docker.com/r/redash/redash/tags) - tag: 10.1.0.b50633 + tag: # image.pullPolicy - Image pull policy pullPolicy: IfNotPresent