Skip to content

Commit abe36a0

Browse files
made probes configurable, fixed formatting, ci cleanup (#171)
* made probes configurable, fixed formatting, ci cleanup * added probes conditions * common volume mounts
1 parent 7af1cee commit abe36a0

File tree

10 files changed

+117
-85
lines changed

10 files changed

+117
-85
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ jobs:
7474
- uses: actions/checkout@v4
7575
with:
7676
fetch-depth: 0
77-
- uses: azure/setup-helm@v4
7877
- name: configure git
7978
run: |
8079
git config user.name "$GITHUB_ACTOR"

charts/redash/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
name: redash
3-
version: 3.1.0-alpha1
4-
appVersion: 24.04.0-dev-b8640593524.10
3+
version: 3.1.0-alpha2
4+
appVersion: 24.04.0-dev-b8665145752.21
55
description: Redash is an open source tool built for teams to query, visualize and collaborate.
66
keywords:
77
- redash

charts/redash/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This chart bootstraps a [Redash](https://github.com/getredash/redash) deployment
88

99
This is a contributed project developed by volunteers and not officially supported by Redash.
1010

11-
Current chart version is `3.1.0-alpha1`
11+
Current chart version is `3.1.0-alpha2`
1212

1313
* <https://github.com/getredash/redash>
1414

@@ -104,6 +104,8 @@ The following table lists the configurable parameters of the Redash chart and th
104104
| migrations.securityContext | object | `{}` | |
105105
| migrations.tolerations | list | `[]` | Tolerations for server pod assignment [ref](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) |
106106
| migrations.ttlSecondsAfterFinished | int | `600` | ttl for install job [ref](https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/) |
107+
| migrations.volumeMounts | list | `[]` | volume mounts for migrations pods |
108+
| migrations.volumes | list | `[]` | volumes that will be mounted to migrations pods only |
107109
| nameOverride | string | `""` | |
108110
| postgresql.auth.database | string | `"redash"` | PostgreSQL database name (when postgresql chart enabled) |
109111
| postgresql.auth.password | string | `nil` | REQUIRED: PostgreSQL password for redash user (when postgresql chart enabled) |
@@ -201,6 +203,7 @@ The following table lists the configurable parameters of the Redash chart and th
201203
| redis.master.service.ports.redis | int | `6379` | |
202204
| scheduler.affinity | object | `{}` | Affinity for scheduler pod assignment [ref](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) |
203205
| scheduler.env | object | `{}` | Redash scheduler specific environment variables. |
206+
| scheduler.livenessProbe | object | `{}` | Liveness probe for scheduler to ensure workers are running fine |
204207
| scheduler.nodeSelector | object | `{}` | Node labels for scheduler pod assignment [ref](https://kubernetes.io/docs/user-guide/node-selection/) |
205208
| scheduler.podAnnotations | object | `{}` | Annotations for scheduler pod assignment [ref](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) |
206209
| scheduler.podLabels | object | `{}` | Labels for scheduler pod assignment [ref](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) |
@@ -213,10 +216,12 @@ The following table lists the configurable parameters of the Redash chart and th
213216
| server.affinity | object | `{}` | Affinity for server pod assignment [ref](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) |
214217
| server.env | object | `{}` | Redash server specific environment variables Don't use this for variables that are in the configuration above, however. |
215218
| server.httpPort | int | `5000` | Server container port (only useful if you are using a customized image) |
219+
| server.livenessProbe | object | `{"failureThreshold":10,"initialDelaySeconds":90,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":1}` | Server liveness probe configuration |
216220
| server.nodeSelector | object | `{}` | Node labels for server pod assignment [ref](https://kubernetes.io/docs/user-guide/node-selection/) |
217221
| server.podAnnotations | object | `{}` | Annotations for server pod assignment [ref](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) |
218222
| server.podLabels | object | `{}` | Labels for server pod assignment [ref](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) |
219223
| server.podSecurityContext | object | `{}` | Security contexts for server pod assignment [ref](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) |
224+
| server.readinessProbe | object | `{"failureThreshold":3,"initialDelaySeconds":10,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":1}` | Server readiness probe configuration |
220225
| server.replicaCount | int | `1` | Number of server pods to run |
221226
| server.resources | object | `{}` | Server resource requests and limits [ref](http://kubernetes.io/docs/user-guide/compute-resources/) |
222227
| server.securityContext | object | `{}` | |
@@ -231,8 +236,10 @@ The following table lists the configurable parameters of the Redash chart and th
231236
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
232237
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
233238
| serviceAccount.name | string | `nil` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
239+
| volumeMounts | list | `[]` | Redash global volume mounts configuration - applied to all containers |
240+
| volumes | list | `[]` | Redash global volumes configuration - applied to all containers |
234241
| worker.affinity | object | `{}` | Default affinity for worker pod assignment [ref](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) |
235-
| worker.livenessProbe | string | `nil` | Default worker's liveness probe to ensure workers are running fine |
242+
| worker.livenessProbe | object | `{}` | Default worker's liveness probe to ensure workers are running fine |
236243
| worker.nodeSelector | object | `{}` | Default node labels for worker pod assignment [ref](https://kubernetes.io/docs/user-guide/node-selection/) |
237244
| worker.podAnnotations | object | `{}` | Default annotations for worker pod assignment [ref](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) |
238245
| worker.podLabels | object | `{}` | Default labels for worker pod assignment [ref](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) |

charts/redash/templates/_helpers.tpl

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,19 @@ Get the secret name.
7474
{{/*
7575
Shared environment block used across each component.
7676
*/}}
77-
{{- define "redash.env" }}
78-
{{- if not .Values.redash.selfManagedSecrets }}
79-
{{- if not .Values.postgresql.enabled }}
77+
{{- define "redash.env" -}}
78+
{{- if not .Values.redash.selfManagedSecrets -}}
79+
{{- if not .Values.postgresql.enabled -}}
8080
- name: REDASH_DATABASE_URL
81-
{{ if .Values.externalPostgreSQLSecret -}}
81+
{{- if .Values.externalPostgreSQLSecret }}
8282
valueFrom:
83-
secretKeyRef:
84-
{{- .Values.externalPostgreSQLSecret | toYaml | nindent 6 }}
85-
{{ else -}}
83+
secretKeyRef: {{ .Values.externalPostgreSQLSecret | toYaml | nindent 6 }}
84+
{{- else }}
8685
value: {{ default "" .Values.externalPostgreSQL | quote }}
8786
{{- end }}
8887
{{- else -}}
8988
- name: REDASH_DATABASE_USER
90-
value: "{{ .Values.postgresql.auth.username }}"
89+
value: {{ .Values.postgresql.auth.username | quote }}
9190
- name: REDASH_DATABASE_PASSWORD
9291
valueFrom:
9392
secretKeyRef:
@@ -96,16 +95,15 @@ Shared environment block used across each component.
9695
- name: REDASH_DATABASE_HOSTNAME
9796
value: {{ include "redash.postgresql.fullname" . }}
9897
- name: REDASH_DATABASE_PORT
99-
value: "{{ .Values.postgresql.primary.service.ports.postgresql }}"
98+
value: {{ .Values.postgresql.primary.service.ports.postgresql | quote }}
10099
- name: REDASH_DATABASE_NAME
101-
value: "{{ .Values.postgresql.auth.database }}"
102-
{{- end }}
100+
value: {{ .Values.postgresql.auth.database | quote }}
101+
{{- end -}}
103102
{{- if not .Values.redis.enabled }}
104103
- name: REDASH_REDIS_URL
105104
{{- if .Values.externalRedisSecret }}
106105
valueFrom:
107-
secretKeyRef:
108-
{{- .Values.externalRedisSecret | toYaml | nindent 6 }}
106+
secretKeyRef: {{ .Values.externalRedisSecret | toYaml | nindent 6 }}
109107
{{- else }}
110108
value: {{ default "" .Values.externalRedis | quote }}
111109
{{- end }}
@@ -122,15 +120,15 @@ Shared environment block used across each component.
122120
- name: REDASH_REDIS_HOSTNAME
123121
value: {{ include "redash.redis.fullname" . }}
124122
- name: REDASH_REDIS_PORT
125-
value: "{{ .Values.redis.master.service.ports.redis }}"
123+
value: {{ .Values.redis.master.service.ports.redis | quote }}
126124
- name: REDASH_REDIS_NAME
127-
value: "{{ .Values.redis.database }}"
128-
{{- end }}
129-
{{- end }}
130-
{{- range $key, $value := .Values.env }}
131-
- name: "{{ $key }}"
132-
value: "{{ $value }}"
133-
{{- end }}
125+
value: {{ .Values.redis.database | quote }}
126+
{{ end -}}
127+
{{- end -}}
128+
{{ range $key, $value := .Values.env -}}
129+
- name: {{ $key | quote }}
130+
value: {{ $value | quote }}
131+
{{ end -}}
134132
## Start primary Redash configuration
135133
{{- if not .Values.redash.selfManagedSecrets }}
136134
{{- if or .Values.redash.secretKey .Values.redash.existingSecret }}
@@ -515,8 +513,8 @@ helm.sh/chart: {{ include "redash.chart" . }}
515513
{{- if .workerName }}
516514
app.kubernetes.io/component: {{ .workerName }}worker
517515
{{- end }}
518-
{{- if .Chart.AppVersion }}
519-
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
516+
{{- if or .Chart.AppVersion .Values.image.tag }}
517+
app.kubernetes.io/version: {{ .Values.image.tag | default .Chart.AppVersion | quote }}
520518
{{- end }}
521519
app.kubernetes.io/managed-by: {{ .Release.Service }}
522520
{{- end -}}

charts/redash/templates/hook-migrations-job.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,21 @@ spec:
3434
args:
3535
- create_db
3636
env:
37-
{{- include "redash.env" . | nindent 10 }}
38-
{{- range $key, $value := .Values.migrations.env }}
39-
- name: "{{ $key }}"
40-
value: "{{ $value }}"
41-
{{- end }}
37+
{{- $envCtx := mergeOverwrite (deepCopy .) (dict "Values" (dict "env" .Values.migrations.env)) -}}
38+
{{- include "redash.env" $envCtx | nindent 10 }}
4239
{{- if (include "redash.envFrom" .) }}
4340
envFrom:
4441
{{- include "redash.envFrom" . | nindent 10 }}
4542
{{- end}}
4643
{{- with .Values.migrations.resources }}
4744
resources: {{ toYaml . | nindent 10 }}
4845
{{- end }}
49-
{{- with .Values.migrations.volumeMounts }}
46+
{{- $volumeMounts := concat .Values.volumeMounts .Values.migrations.volumeMounts }}
47+
{{- with $volumeMounts }}
5048
volumeMounts: {{ toYaml . | nindent 10 }}
5149
{{- end }}
52-
{{- with .Values.migrations.volumes }}
50+
{{- $volumes := concat .Values.volumes .Values.migrations.volumes -}}
51+
{{- with $volumes }}
5352
volumes: {{ toYaml . | nindent 8 }}
5453
{{- end }}
5554
{{- with .Values.migrations.nodeSelector }}

charts/redash/templates/scheduler-deployment.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,26 @@ spec:
3838
securityContext: {{ toYaml .Values.scheduler.securityContext | nindent 12 }}
3939
image: {{ .Values.image.registry }}/{{ .Values.image.repo }}:{{ .Values.image.tag | default .Chart.AppVersion }}
4040
imagePullPolicy: {{ .Values.image.pullPolicy }}
41-
{{- with .Values.scheduler.volumeMounts }}
41+
{{- $volumeMounts := concat .Values.volumeMounts .Values.scheduler.volumeMounts }}
42+
{{- with $volumeMounts }}
4243
volumeMounts: {{ toYaml . | nindent 12 }}
4344
{{- end }}
4445
args:
4546
- scheduler
4647
env:
47-
{{- include "redash.env" . | nindent 12 }}
48-
{{- range $key, $value := .Values.scheduler.env }}
49-
- name: "{{ $key }}"
50-
value: "{{ $value }}"
51-
{{- end }}
48+
{{- $envCtx := mergeOverwrite (deepCopy .) (dict "Values" (dict "env" .Values.scheduler.env)) -}}
49+
{{- include "redash.env" $envCtx | nindent 12 }}
5250
{{- with (include "redash.envFrom" .) }}
5351
envFrom: {{ . | nindent 12 }}
5452
{{- end }}
5553
{{- with .Values.scheduler.resources }}
5654
resources: {{ toYaml . | nindent 12 }}
5755
{{- end }}
58-
{{- with .Values.scheduler.volumes }}
56+
{{- with .Values.scheduler.livenessProbe }}
57+
livenessProbe: {{ toYaml . | nindent 12 }}
58+
{{- end }}
59+
{{- $volumes := concat .Values.volumes .Values.scheduler.volumes }}
60+
{{- with $volumes }}
5961
volumes: {{ toYaml . | nindent 8 }}
6062
{{- end }}
6163
{{- with .Values.scheduler.nodeSelector }}

charts/redash/templates/secrets.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ metadata:
88
type: Opaque
99
data:
1010
## Start primary Redash configuration
11-
{{ $null := required "A value for one of the following variables is required: redash.secretKey (secure random value), redash.existingSecret (secret name)" (or .Values.redash.secretKey .Values.redash.existingSecret) }}
11+
{{- $null := required "A value for one of the following variables is required: redash.secretKey (secure random value), redash.existingSecret (secret name)" (or .Values.redash.secretKey .Values.redash.existingSecret) }}
1212
secretKey: {{ default "" .Values.redash.secretKey | b64enc | quote }}
1313
googleClientSecret: {{ default "" .Values.redash.googleClientSecret | b64enc | quote }}
1414
ldapBindDnPassword: {{ default "" .Values.redash.ldapBindDnPassword | b64enc | quote }}
15-
{{ $null := required "A value for one of the following variables is required: redash.cookieSecret (secure random value), redash.existingSecret (secret name)" (or .Values.redash.cookieSecret .Values.redash.existingSecret) }}
15+
{{- $null := required "A value for one of the following variables is required: redash.cookieSecret (secure random value), redash.existingSecret (secret name)" (or .Values.redash.cookieSecret .Values.redash.existingSecret) }}
1616
cookieSecret: {{ default "" .Values.redash.cookieSecret | b64enc | quote }}
1717
mailPassword: {{ default "" .Values.redash.mailPassword | b64enc | quote }}
1818
## End primary Redash configuration

charts/redash/templates/server-deployment.yaml

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,45 +36,32 @@ spec:
3636
securityContext: {{ toYaml .Values.server.securityContext | nindent 12 }}
3737
image: {{ .Values.image.registry }}/{{ .Values.image.repo }}:{{ .Values.image.tag | default .Chart.AppVersion }}
3838
imagePullPolicy: {{ .Values.image.pullPolicy }}
39-
{{- with .Values.server.volumeMounts }}
39+
{{- $volumeMounts := concat .Values.volumeMounts .Values.server.volumeMounts }}
40+
{{- with $volumeMounts }}
4041
volumeMounts: {{ toYaml . | nindent 12 }}
4142
{{- end }}
4243
args:
4344
- server
4445
env:
45-
{{- include "redash.env" . | nindent 12 }}
46-
{{- range $key, $value := .Values.server.env }}
47-
- name: "{{ $key }}"
48-
value: "{{ $value }}"
49-
{{- end }}
50-
{{ with (include "redash.envFrom" .) -}}
46+
{{- $envCtx := mergeOverwrite (deepCopy .) (dict "Values" (dict "env" .Values.server.env)) -}}
47+
{{- include "redash.env" $envCtx | nindent 12 }}
48+
{{- with (include "redash.envFrom" .) }}
5149
envFrom: {{ . | nindent 12 }}
5250
{{- end }}
5351
ports:
5452
- containerPort: {{ .Values.server.httpPort }}
55-
livenessProbe:
56-
httpGet:
57-
path: /ping
58-
port: {{ .Values.server.httpPort }}
59-
# Redash can take a while to come up initially, so we delay checks.
60-
initialDelaySeconds: 90
61-
timeoutSeconds: 1
62-
periodSeconds: 10
63-
successThreshold: 1
64-
failureThreshold: 10
65-
readinessProbe:
66-
httpGet:
67-
path: /ping
68-
port: {{ .Values.server.httpPort }}
69-
initialDelaySeconds: 10
70-
timeoutSeconds: 1
71-
periodSeconds: 10
72-
successThreshold: 1
73-
failureThreshold: 3
53+
{{- $defaultProbe := dict "httpGet" (dict "path" "/ping" "port" .Values.server.httpPort) -}}
54+
{{- with .Values.server.livenessProbe }}
55+
livenessProbe: {{ deepCopy . | mergeOverwrite $defaultProbe | toYaml | nindent 12 }}
56+
{{- end }}
57+
{{- with .Values.server.readinessProbe }}
58+
readinessProbe: {{ deepCopy . | mergeOverwrite $defaultProbe | toYaml | nindent 12 }}
59+
{{- end }}
7460
{{- with .Values.server.resources }}
7561
resources: {{ toYaml .Values.server.resources | nindent 12 }}
7662
{{- end }}
77-
{{- with .Values.server.volumes }}
63+
{{- $volumes := concat .Values.volumes .Values.server.volumes -}}
64+
{{- with $volumes }}
7865
volumes: {{ toYaml . | nindent 8 }}
7966
{{- end }}
8067
{{- with .Values.server.nodeSelector }}

charts/redash/templates/worker-deployment.yaml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{ range $workerName, $config := .Values.workers -}}
2-
{{- $workerConfig := merge (deepCopy $.Values.worker) $config }}
3-
{{- $context := deepCopy $ | merge (dict "workerName" $workerName)}}
2+
{{- $workerConfig := mergeOverwrite (deepCopy $.Values.worker) $config }}
3+
{{- $context := mergeOverwrite (deepCopy $) (dict "workerName" $workerName)}}
44
---
55
apiVersion: apps/v1
66
kind: Deployment
@@ -36,23 +36,24 @@ spec:
3636
imagePullPolicy: {{ $.Values.image.pullPolicy }}
3737
args:
3838
- worker
39-
{{ with $workerConfig.volumeMounts -}}
39+
{{- $volumeMounts := concat $.Values.volumeMounts $workerConfig.volumeMounts }}
40+
{{- with $volumeMounts }}
4041
volumeMounts: {{ toYaml . | nindent 12 }}
4142
{{- end -}}
42-
livenessProbe: {{ toYaml $workerConfig.livenessProbe | nindent 12 }}
43-
env:
44-
{{- include "redash.env" $ | nindent 12 }}
45-
{{- range $key, $value := $workerConfig.env }}
46-
- name: "{{ $key }}"
47-
value: "{{ $value }}"
43+
{{- with $workerConfig.livenessProbe }}
44+
livenessProbe: {{ toYaml . | nindent 12 }}
4845
{{- end }}
46+
env:
47+
{{- $envCtx := mergeOverwrite (deepCopy $) (dict "Values" (dict "env" $workerConfig.env)) -}}
48+
{{- include "redash.env" $envCtx | nindent 12 }}
4949
{{- with (include "redash.envFrom" $) }}
5050
envFrom: {{ . | nindent 12 }}
5151
{{- end }}
5252
{{- with $workerConfig.resources }}
5353
resources: {{ toYaml . | nindent 12 }}
5454
{{- end }}
55-
{{- with $workerConfig.volumes }}
55+
{{- $volumes := concat $.Values.volumes $workerConfig.volumes -}}
56+
{{- with $volumes }}
5657
volumes: {{ toYaml . | nindent 8 }}
5758
{{- end }}
5859
{{- with $workerConfig.nodeSelector }}

0 commit comments

Comments
 (0)