From d21e716e9bf7a6cc6aadf9625edb83445ce920b4 Mon Sep 17 00:00:00 2001 From: Andrew Chubatiuk Date: Sun, 14 Apr 2024 21:24:24 +0300 Subject: [PATCH] added init containers configuration --- charts/redash/Chart.yaml | 2 +- charts/redash/README.md | 7 ++++++- charts/redash/templates/_helpers.tpl | 2 +- charts/redash/templates/hook-migrations-job.yaml | 4 ++++ charts/redash/templates/scheduler-deployment.yaml | 4 ++++ charts/redash/templates/server-deployment.yaml | 4 ++++ charts/redash/templates/worker-deployment.yaml | 3 +++ charts/redash/values.yaml | 15 +++++++++++++++ 8 files changed, 38 insertions(+), 3 deletions(-) diff --git a/charts/redash/Chart.yaml b/charts/redash/Chart.yaml index ee9eebe..607600e 100644 --- a/charts/redash/Chart.yaml +++ b/charts/redash/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: redash -version: 3.1.0-alpha4 +version: 3.1.0-alpha5 appVersion: 24.04.0-dev-b8671264667.25 description: Redash is an open source tool built for teams to query, visualize and collaborate. keywords: diff --git a/charts/redash/README.md b/charts/redash/README.md index 11ff3df..480a33b 100644 --- a/charts/redash/README.md +++ b/charts/redash/README.md @@ -8,7 +8,7 @@ This chart bootstraps a [Redash](https://github.com/getredash/redash) deployment This is a contributed project developed by volunteers and not officially supported by Redash. -Current chart version is `3.1.0-alpha4` +Current chart version is `3.1.0-alpha5` * @@ -96,7 +96,9 @@ The following table lists the configurable parameters of the Redash chart and th | ingress.ingressClassName | string | `""` | Sets the ingress controller class name to use. | | ingress.pathType | string | `"Prefix"` | How ingress paths should be treated. | | ingress.tls | list | `[]` | Ingress TLS configuration | +| initContainers | list | `[]` | Redash global init containers | | migrations.affinity | object | `{}` | Affinity for scheduled worker pod assignment [ref](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) | +| migrations.initContainers | list | `[]` | migrations init container configuration | | migrations.nodeSelector | object | `{}` | Node labels for scheduled worker pod assignment [ref](https://kubernetes.io/docs/user-guide/node-selection/) | | migrations.podAnnotations | object | `{}` | Annotations for scheduled worker pod assignment [ref](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) | | migrations.podSecurityContext | object | `{}` | Security contexts for scheduled worker pod assignment [ref](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) | @@ -203,6 +205,7 @@ The following table lists the configurable parameters of the Redash chart and th | redis.master.service.ports.redis | int | `6379` | | | scheduler.affinity | object | `{}` | Affinity for scheduler pod assignment [ref](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) | | scheduler.env | object | `{}` | Redash scheduler specific environment variables. | +| scheduler.initContainers | list | `[]` | Redash scheduler init containers configuration. | | scheduler.livenessProbe | object | `{}` | Liveness probe for scheduler to ensure workers are running fine | | scheduler.nodeSelector | object | `{}` | Node labels for scheduler pod assignment [ref](https://kubernetes.io/docs/user-guide/node-selection/) | | scheduler.podAnnotations | object | `{}` | Annotations for scheduler pod assignment [ref](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) | @@ -216,6 +219,7 @@ The following table lists the configurable parameters of the Redash chart and th | server.affinity | object | `{}` | Affinity for server pod assignment [ref](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) | | server.env | object | `{}` | Redash server specific environment variables Don't use this for variables that are in the configuration above, however. | | server.httpPort | int | `5000` | Server container port (only useful if you are using a customized image) | +| server.initContainers | list | `[]` | Server init containers configuration | | server.livenessProbe | object | `{"failureThreshold":10,"initialDelaySeconds":90,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":1}` | Server liveness probe configuration | | server.nodeSelector | object | `{}` | Node labels for server pod assignment [ref](https://kubernetes.io/docs/user-guide/node-selection/) | | server.podAnnotations | object | `{}` | Annotations for server pod assignment [ref](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) | @@ -239,6 +243,7 @@ The following table lists the configurable parameters of the Redash chart and th | volumeMounts | list | `[]` | Redash global volume mounts configuration - applied to all containers | | volumes | list | `[]` | Redash global volumes configuration - applied to all containers | | worker.affinity | object | `{}` | Default affinity for worker pod assignment [ref](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) | +| worker.initContainers | list | `[]` | Worker default init containers configuration | | worker.livenessProbe | object | `{}` | Default worker's liveness probe to ensure workers are running fine | | worker.nodeSelector | object | `{}` | Default node labels for worker pod assignment [ref](https://kubernetes.io/docs/user-guide/node-selection/) | | worker.podAnnotations | object | `{}` | Default annotations for worker pod assignment [ref](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) | diff --git a/charts/redash/templates/_helpers.tpl b/charts/redash/templates/_helpers.tpl index 1ac08e6..48fc3f9 100644 --- a/charts/redash/templates/_helpers.tpl +++ b/charts/redash/templates/_helpers.tpl @@ -128,7 +128,7 @@ Shared environment block used across each component. value: {{ .Values.redis.database | quote }} {{ end -}} {{ range $key, $value := .Values.env -}} -- name: {{ $key | quote }} +- name: {{ $key }} value: {{ $value | quote }} {{ end -}} ## Start primary Redash configuration diff --git a/charts/redash/templates/hook-migrations-job.yaml b/charts/redash/templates/hook-migrations-job.yaml index 94e53a4..2a39b6f 100644 --- a/charts/redash/templates/hook-migrations-job.yaml +++ b/charts/redash/templates/hook-migrations-job.yaml @@ -26,6 +26,10 @@ spec: serviceAccountName: {{ include "redash.serviceAccountName" . }} restartPolicy: Never securityContext: {{ toYaml .Values.migrations.podSecurityContext | nindent 8 }} + {{- $initContainers := concat .Values.initContainers .Values.migrations.initContainers }} + {{- with $initContainers }} + initContainers: {{ toYaml . | nindent 8 }} + {{- end }} containers: - name: {{ include "redash.name" . }}-server securityContext: {{ toYaml .Values.migrations.securityContext | nindent 10 }} diff --git a/charts/redash/templates/scheduler-deployment.yaml b/charts/redash/templates/scheduler-deployment.yaml index 416a4de..571c179 100644 --- a/charts/redash/templates/scheduler-deployment.yaml +++ b/charts/redash/templates/scheduler-deployment.yaml @@ -30,6 +30,10 @@ spec: {{ end -}} serviceAccountName: {{ include "redash.serviceAccountName" . }} securityContext: {{ toYaml .Values.scheduler.podSecurityContext | nindent 8 }} + {{- $initContainers := concat .Values.initContainers .Values.scheduler.initContainers }} + {{- with $initContainers }} + initContainers: {{ toYaml . | nindent 8 }} + {{- end }} containers: {{- with .Values.scheduler.extraContainers -}} {{ toYaml . | nindent 8 }} diff --git a/charts/redash/templates/server-deployment.yaml b/charts/redash/templates/server-deployment.yaml index 8097952..99d78ea 100644 --- a/charts/redash/templates/server-deployment.yaml +++ b/charts/redash/templates/server-deployment.yaml @@ -28,6 +28,10 @@ spec: {{ end -}} serviceAccountName: {{ include "redash.serviceAccountName" . }} securityContext: {{ toYaml .Values.server.podSecurityContext | nindent 8 }} + {{- $initContainers := concat .Values.initContainers .Values.server.initContainers }} + {{- with $initContainers }} + initContainers: {{ toYaml . | nindent 8 }} + {{- end }} containers: {{- with .Values.server.extraContainers -}} {{- toYaml . | nindent 8 }} diff --git a/charts/redash/templates/worker-deployment.yaml b/charts/redash/templates/worker-deployment.yaml index f78cd31..9a448ab 100644 --- a/charts/redash/templates/worker-deployment.yaml +++ b/charts/redash/templates/worker-deployment.yaml @@ -26,6 +26,9 @@ spec: {{- end -}} serviceAccountName: {{ include "redash.serviceAccountName" $context }} securityContext: {{ toYaml $workerConfig.podSecurityContext | nindent 8 }} + {{- with concat $.Values.initContainers $workerConfig.initContainers }} + initContainers: {{ toYaml . | nindent 8 }} + {{- end }} containers: {{- with $workerConfig.extraContainers -}} {{- toYaml . | nindent 8 }} diff --git a/charts/redash/values.yaml b/charts/redash/values.yaml index 567a1ab..34e5c10 100644 --- a/charts/redash/values.yaml +++ b/charts/redash/values.yaml @@ -20,6 +20,9 @@ env: PYTHONUNBUFFERED: 0 REDASH_PRODUCTION: "true" +# initContainers -- Redash global init containers +initContainers: [] + # volumes -- Redash global volumes configuration - applied to all containers volumes: [] @@ -287,6 +290,9 @@ server: # server.httpPort -- Server container port (only useful if you are using a customized image) httpPort: 5000 + # server.initContainers -- Server init containers configuration + initContainers: [] + # server.env -- Redash server specific environment variables # Don't use this for variables that are in the configuration above, however. env: {} @@ -404,6 +410,9 @@ worker: # worker.replicaCount -- Default number of worker pods to run replicaCount: 1 + # worker.initContainers -- Worker default init containers configuration + initContainers: [] + # worker.resources -- Worker default resource requests and limits [ref](http://kubernetes.io/docs/user-guide/compute-resources/) resources: # limits: @@ -453,6 +462,9 @@ scheduler: # scheduler.env -- Redash scheduler specific environment variables. env: {} + # scheduler.initContainers -- Redash scheduler init containers configuration. + initContainers: [] + # scheduler.resources -- scheduler resource requests and limits [ref](http://kubernetes.io/docs/user-guide/compute-resources/) resources: # limits: @@ -502,6 +514,9 @@ migrations: # migrations.volumes -- volumes that will be mounted to migrations pods only volumes: [] + # migrations.initContainers -- migrations init container configuration + initContainers: [] + # migrations.volumeMounts -- volume mounts for migrations pods volumeMounts: []