diff --git a/charts/substra-backend/CHANGELOG.md b/charts/substra-backend/CHANGELOG.md index 3f56da53a..05c3dac0d 100644 --- a/charts/substra-backend/CHANGELOG.md +++ b/charts/substra-backend/CHANGELOG.md @@ -1,6 +1,12 @@ # Changelog +## [26.14.0] - 2024-10-09 + +# Added + +Pods relying on redis uses a new init container `wait-redis` which wait for redis to be up before spawning + ## [26.13.0] - 2024-09-30 # Added diff --git a/charts/substra-backend/Chart.yaml b/charts/substra-backend/Chart.yaml index 7bd60b33b..83efc1002 100644 --- a/charts/substra-backend/Chart.yaml +++ b/charts/substra-backend/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: substra-backend home: https://github.com/Substra -version: 26.13.0 +version: 26.14.0 appVersion: 0.48.0 kubeVersion: '>= 1.19.0-0' description: Main package for Substra diff --git a/charts/substra-backend/templates/_helpers.tpl b/charts/substra-backend/templates/_helpers.tpl index e2abe464f..76737d87a 100644 --- a/charts/substra-backend/templates/_helpers.tpl +++ b/charts/substra-backend/templates/_helpers.tpl @@ -254,6 +254,20 @@ The hostname we should connect to (external is defined, otherwise integrated) {{- end }} {{- end -}} +{{- define "common.waitRedisInitContainer" -}} +{{- if .Values.redis.enabled }} +- name: wait-redis + image: jwilder/dockerize:0.6.1 + securityContext: + allowPrivilegeEscalation: false + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault + capabilities: + drop: ["ALL"] + command: ['dockerize', '-wait', 'tcp://{{ default (include "redis.serviceName" .) .Values.redis.host }}:{{ .Values.redis.master.service.ports.redis }}', '-timeout', '5m'] +{{- end }} +{{- end -}} {{/* `wait-postgresql` container initialisation used inside of `initContainers` diff --git a/charts/substra-backend/templates/deployment-api-events.yaml b/charts/substra-backend/templates/deployment-api-events.yaml index 459b7e8f7..6a55736e9 100644 --- a/charts/substra-backend/templates/deployment-api-events.yaml +++ b/charts/substra-backend/templates/deployment-api-events.yaml @@ -109,6 +109,7 @@ spec: {{- include "common.addCertInitContainer" . | nindent 8 }} {{- include "common.waitPostgresqlInitContainer" . | nindent 8 }} {{- include "common.waitInitMigrationsInitContainer" . | nindent 8}} + {{- include "common.waitRedisInitContainer" . | nindent 8 }} volumes: - name: volume-wait-init-migrations configMap: diff --git a/charts/substra-backend/templates/deployment-scheduler-worker.yaml b/charts/substra-backend/templates/deployment-scheduler-worker.yaml index 0c1bf6e94..2bb36a3c1 100644 --- a/charts/substra-backend/templates/deployment-scheduler-worker.yaml +++ b/charts/substra-backend/templates/deployment-scheduler-worker.yaml @@ -98,6 +98,7 @@ spec: {{- toYaml .Values.schedulerWorker.resources | nindent 12 }} initContainers: {{- include "common.addCertInitContainer" . | nindent 8 }} + {{- include "common.waitRedisInitContainer" . | nindent 8 }} volumes: {{- if .Values.privateCa.enabled }} - name: ssl-certs diff --git a/charts/substra-backend/templates/deployment-scheduler.yaml b/charts/substra-backend/templates/deployment-scheduler.yaml index 068637dba..723d34823 100644 --- a/charts/substra-backend/templates/deployment-scheduler.yaml +++ b/charts/substra-backend/templates/deployment-scheduler.yaml @@ -99,6 +99,8 @@ spec: {{ end }} resources: {{- toYaml .Values.scheduler.resources | nindent 12 }} + initContainers: + {{- include "common.waitRedisInitContainer" . | nindent 8 }} volumes: - name: runtime-db emptyDir: {} diff --git a/charts/substra-backend/templates/deployment-server.yaml b/charts/substra-backend/templates/deployment-server.yaml index 8f4286725..c2f01112d 100644 --- a/charts/substra-backend/templates/deployment-server.yaml +++ b/charts/substra-backend/templates/deployment-server.yaml @@ -247,6 +247,7 @@ spec: - name: DJANGO_SETTINGS_MODULE value: backend.settings.{{ .Values.settings }} {{- include "common.waitMinIOContainer" . | nindent 6 }} + {{- include "common.waitRedisInitContainer" . | nindent 6 }} volumes: - name: data-servermedias persistentVolumeClaim: diff --git a/charts/substra-backend/templates/deployment-worker-events.yaml b/charts/substra-backend/templates/deployment-worker-events.yaml index 1bd6a8a21..ca7c49348 100644 --- a/charts/substra-backend/templates/deployment-worker-events.yaml +++ b/charts/substra-backend/templates/deployment-worker-events.yaml @@ -111,6 +111,7 @@ spec: {{- include "common.addCertInitContainer" . | nindent 8 }} {{- include "common.waitPostgresqlInitContainer" . | nindent 8 }} {{- include "common.waitInitMigrationsInitContainer" . | nindent 8}} + {{- include "common.waitRedisInitContainer" . | nindent 8 }} volumes: - name: volume-wait-init-migrations configMap: diff --git a/charts/substra-backend/templates/statefulset-builder.yaml b/charts/substra-backend/templates/statefulset-builder.yaml index 3f81b6d3d..584e7d4ec 100644 --- a/charts/substra-backend/templates/statefulset-builder.yaml +++ b/charts/substra-backend/templates/statefulset-builder.yaml @@ -68,6 +68,7 @@ spec: serviceAccountName: {{ template "substra.fullname" . }}-builder initContainers: {{- include "common.waitPostgresqlInitContainer" . | nindent 6 }} + {{- include "common.waitRedisInitContainer" . | nindent 6 }} {{- if .Values.privateCa.enabled }} - name: add-cert image: {{ include "common.images.name" .Values.privateCa.image }}