From 730bdaba75489822c36a38c7314241490b1c430f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikke=20Schir=C3=A9n?= Date: Tue, 1 Aug 2023 23:15:03 +0200 Subject: [PATCH] move bootstrap to init container --- charts/directus/Chart.yaml | 2 +- charts/directus/templates/deployment.yaml | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/charts/directus/Chart.yaml b/charts/directus/Chart.yaml index eeca452..71674d5 100644 --- a/charts/directus/Chart.yaml +++ b/charts/directus/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.1 +version: 0.5.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/directus/templates/deployment.yaml b/charts/directus/templates/deployment.yaml index 7a49e3a..6c14ea4 100644 --- a/charts/directus/templates/deployment.yaml +++ b/charts/directus/templates/deployment.yaml @@ -27,19 +27,36 @@ spec: serviceAccountName: {{ include "directus.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} - {{- if .Values.initContainers }} initContainers: + - name: {{ .Chart.Name }}-init + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + command: ["node"] + args: ["/directus/cli.js", "bootstrap"] + env: + {{- if .Values.ingress.enabled }} + - name: PUBLIC_URL + value: http{{ if .Values.ingress.tls }}s{{ end }}://{{(index .Values.ingress.hosts 0).host }} + {{- end }} + {{- if .Values.extraEnvVars }} + {{- tpl (toYaml .Values.extraEnvVars) $ | nindent 12 }} + {{- end }} + {{- if .Values.initContainers }} {{ toYaml .Values.initContainers | indent 8 }} {{- end }} containers: {{- if .Values.sidecars }} {{ toYaml .Values.sidecars | indent 8 }} - {{- end }} + {{- end }} - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + command: ["node"] + args: ["/directus/cli.js", "start"] env: {{- if .Values.ingress.enabled }} - name: PUBLIC_URL