Skip to content

Commit

Permalink
updated docs, removed custom entrypoint scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewChubatiuk committed Mar 27, 2024
1 parent 51b6e97 commit 063efe4
Show file tree
Hide file tree
Showing 9 changed files with 252 additions and 346 deletions.
348 changes: 176 additions & 172 deletions README.md

Large diffs are not rendered by default.

17 changes: 15 additions & 2 deletions README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ redash:
cookieSecret: $(openssl rand -base64 32)
secretKey: $(openssl rand -base64 32)
postgresql:
postgresqlPassword: $(openssl rand -base64 32)
auth:
password: $(openssl rand -base64 32)
redis:
password: $(openssl rand -base64 32)
auth:
password: $(openssl rand -base64 32)
EOM
```

Expand Down Expand Up @@ -85,6 +87,17 @@ helm upgrade --reuse-values my-release redash/redash

Below are notes on manual configuration changes or steps needed for major chart version updates.

### From 3.0 to 3.1

- Upgraded Redis and PostgreSQL dependency charts, which have new parameters names. Please follow [README.md](./README.md) and official [Redis](https://github.com/bitnami/charts/tree/main/bitnami/redis) and [PostgreSQL](https://github.com/bitnami/charts/tree/main/bitnami/postgresql) charts guides.
- Merged workers configuration to simplify their setup:
- `adhocWorker` => `workers.adhoc`
- `genericWorker` => `workers.generic`
- `scheduledWorker` => `workers.scheduled`
- default config for all workers is at `worker` section
- replaced `hookInstallJob` and `hookUpgradeJob` with `migrations`
- Moved custom entrypoint scripts to [Redash repo](https://github.com/getredash/redash/pull/6674)

### From 2.x to 3.x

- The Redash version is updated from v8 to v10 (v9 never had a stable release)
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-env-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def upper_repl(match):
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"]:
if env in ["REDASH_CACHE_URL", "REDASH_DB_URL"]:
continue
secret = False
if env in [
Expand Down
24 changes: 12 additions & 12 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -77,31 +77,31 @@ Shared environment block used across each component.
{{- define "redash.env" }}
{{- if not .Values.redash.selfManagedSecrets }}
{{- if not .Values.postgresql.enabled }}
- name: REDASH_DATABASE_URL
- name: REDASH_DB_URL
{{ if .Values.externalPostgreSQLSecret -}}
valueFrom:
secretKeyRef:
{{- .Values.externalPostgreSQLSecret | toYaml | nindent 6 }}
{{ else -}}
value: {{ default "" .Values.externalPostgreSQL | quote }}
{{- end }}
{{ else -}}
- name: REDASH_DATABASE_USER
{{- else -}}
- name: REDASH_DB_USER
value: "{{ .Values.postgresql.auth.username }}"
- name: REDASH_DATABASE_PASSWORD
- name: REDASH_DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-postgresql
key: password
- name: REDASH_DATABASE_HOSTNAME
- name: REDASH_DB_HOSTNAME
value: {{ include "redash.postgresql.fullname" . }}
- name: REDASH_DATABASE_PORT
- name: REDASH_DB_PORT
value: "{{ .Values.postgresql.primary.service.ports.postgresql }}"
- name: REDASH_DATABASE_DB
- name: REDASH_DB_NAME
value: "{{ .Values.postgresql.auth.database }}"
{{- end }}
{{- if not .Values.redis.enabled }}
- name: REDASH_REDIS_URL
- name: REDASH_CACHE_URL
{{- if .Values.externalRedisSecret }}
valueFrom:
secretKeyRef:
Expand All @@ -110,7 +110,7 @@ Shared environment block used across each component.
value: {{ default "" .Values.externalRedis | quote }}
{{- end }}
{{- else }}
- name: REDASH_REDIS_PASSWORD
- name: REDASH_CACHE_PASSWORD
valueFrom:
secretKeyRef:
{{- if .Values.redis.existingSecret }}
Expand All @@ -119,11 +119,11 @@ Shared environment block used across each component.
name: {{ .Release.Name }}-redis
{{- end }}
key: redis-password
- name: REDASH_REDIS_HOSTNAME
- name: REDASH_CACHE_HOSTNAME
value: {{ include "redash.redis.fullname" . }}
- name: REDASH_REDIS_PORT
- name: REDASH_CACHE_PORT
value: "{{ .Values.redis.master.service.ports.redis }}"
- name: REDASH_REDIS_DB
- name: REDASH_CACHE_NAME
value: "{{ .Values.redis.database }}"
{{- end }}
{{- end }}
Expand Down
84 changes: 0 additions & 84 deletions templates/configmap.yaml

This file was deleted.

30 changes: 12 additions & 18 deletions templates/hook-migrations-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,35 +34,29 @@ spec:
- name: {{ include "redash.name" . }}-server
securityContext:
{{- toYaml .Values.migrations.securityContext | nindent 10 }}
image: {{ .Values.image.registry }}/{{ .Values.image.repo }}:{{ .Values.image.tag }}
image: "{{ .Values.image.registry }}/{{ .Values.image.repo }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/bin/bash", "/config/install-upgrade.sh"]
volumeMounts:
- name: config
mountPath: /config
args:
- migrate
env:
{{- include "redash.env" . | nindent 10 }}
{{- range $key, $value := .Values.server.env }}
{{- range $key, $value := .Values.migrations.env }}
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
{{- if (include "redash.envFrom" .) }}
envFrom:
{{- include "redash.envFrom" . | nindent 10 }}
{{- end}}
{{- if (.Values.server.resources) }}
resources: {{ toYaml .Values.server.resources | nindent 10 }}
{{- if (.Values.migrations.resources) }}
resources: {{ toYaml .Values.migrations.resources | nindent 10 }}
{{- end }}
volumes:
- name: config
configMap:
name: {{ include "redash.fullname" . }}
{{- with .Values.migrations.nodeSelector }}
{{- with .Values.migrations.nodeSelector }}
nodeSelector: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.migrations.affinity }}
{{- end }}
{{- with .Values.migrations.affinity }}
affinity: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.migrations.tolerations }}
{{- end }}
{{- with .Values.migrations.tolerations }}
tolerations: {{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
38 changes: 15 additions & 23 deletions templates/scheduler-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,12 @@ spec:
{{- toYaml .Values.scheduler.securityContext | nindent 12 }}
image: {{ .Values.image.registry }}/{{ .Values.image.repo }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/bin/sh"]
args: ["-c", ". /config/dynamicenv.sh && /app/bin/docker-entrypoint scheduler"]
{{- with .Values.scheduler.volumeMounts }}
volumeMounts:
- name: config
mountPath: /config
{{- with .Values.scheduler.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
args:
- scheduler
env:
{{- include "redash.env" . | nindent 12 }}
{{- range $key, $value := .Values.scheduler.env }}
Expand All @@ -60,22 +58,16 @@ spec:
{{- if .Values.scheduler.resources }}
resources: {{ toYaml .Values.scheduler.resources | nindent 12 }}
{{- end }}
{{- with .Values.scheduler.volumes }}
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 | indent 8 }}
{{- end }}
{{- with .Values.scheduler.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.scheduler.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- end }}
{{- if .Values.scheduler.nodeSelector }}
nodeSelector: {{ toYaml .Values.scheduler.nodeSelector | nindent 8 }}
{{- end }}
{{- with .Values.scheduler.affinity }}
affinity: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.scheduler.tolerations }}
tolerations: {{ toYaml . | nindent 8 }}
{{- end }}
38 changes: 15 additions & 23 deletions templates/server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ spec:
{{- toYaml .Values.server.securityContext | nindent 12 }}
image: {{ .Values.image.registry }}/{{ .Values.image.repo }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/bin/sh"]
args: ["-c", ". /config/dynamicenv.sh && /app/bin/docker-entrypoint server"]
{{- with .Values.server.volumeMounts }}
volumeMounts:
- name: config
mountPath: /config
{{- with .Values.server.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
args:
- server
env:
{{- include "redash.env" . | nindent 12 }}
{{- range $key, $value := .Values.server.env }}
Expand Down Expand Up @@ -79,22 +77,16 @@ spec:
{{- if .Values.server.resources }}
resources: {{ toYaml .Values.server.resources | nindent 12 }}
{{- end }}
{{- with .Values.server.volumes }}
volumes:
- name: config
configMap:
name: {{ include "redash.fullname" . }}
{{- with .Values.server.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.server.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.server.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.server.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- end }}
{{- with .Values.server.nodeSelector }}
nodeSelector: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.server.affinity }}
affinity: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.server.tolerations }}
tolerations: {{ toYaml . | nindent 8 }}
{{- end }}
17 changes: 6 additions & 11 deletions templates/worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ spec:
{{- toYaml $workerConfig.securityContext | nindent 12 }}
image: {{ $.Values.image.registry }}/{{ $.Values.image.repo }}:{{ $.Values.image.tag }}
imagePullPolicy: {{ $.Values.image.pullPolicy }}
command: ["/bin/sh"]
args: ["-c", ". /config/dynamicenv.sh && /app/bin/docker-entrypoint worker"]
args:
- worker
{{- with $workerConfig.volumeMounts }}
volumeMounts:
- name: config
mountPath: /config
{{- with $workerConfig.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
livenessProbe: {{ toYaml $workerConfig.livenessProbe | nindent 12 }}
env:
{{- include "redash.env" $ | nindent 12 }}
Expand All @@ -60,13 +58,10 @@ spec:
{{- if $workerConfig.resources }}
resources: {{ toYaml $workerConfig.resources | nindent 12 }}
{{- end }}
{{- with $workerConfig.volumes }}
volumes:
- name: config
configMap:
name: {{ include "redash.fullname" $context }}
{{- with $workerConfig.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- if $workerConfig.nodeSelector }}
nodeSelector: {{ toYaml $workerConfig.nodeSelector | nindent 8 }}
{{- end }}
Expand Down

0 comments on commit 063efe4

Please sign in to comment.