diff --git a/charts/queen/Chart.yaml b/charts/queen/Chart.yaml index 4413926..b6c1b5b 100644 --- a/charts/queen/Chart.yaml +++ b/charts/queen/Chart.yaml @@ -5,9 +5,9 @@ description: A Helm chart for Queen API, UI and DB dependencies: - name: postgresql condition: postgresql.enabled - version: 12.1.9 + version: 14.10.0 repository: https://charts.bitnami.com/bitnami type: application -version: 0.4.1 -appVersion: "1.16.0" +version: 0.5.0 +appVersion: "4.0.0" diff --git a/charts/queen/templates/api/deployment.yaml b/charts/queen/templates/api/deployment.yaml index 84853f3..a380ffc 100644 --- a/charts/queen/templates/api/deployment.yaml +++ b/charts/queen/templates/api/deployment.yaml @@ -26,6 +26,12 @@ spec: serviceAccountName: {{ include "queen.api.serviceAccountName" . }} securityContext: {{- toYaml .Values.api.podSecurityContext | nindent 8 }} + initContainers: + - name: check-db-ready + image: postgres:14.10 + command: ['sh', '-c', + until pg_isready -h {{ include "queen.postgresql.fullname" . }} -p {{ .Values.postgresql.auth.port}}; + do echo waiting for database; sleep 2; done;] containers: - name: {{ .Chart.Name }} securityContext: @@ -34,17 +40,15 @@ spec: imagePullPolicy: {{ .Values.api.image.pullPolicy }} {{- if .Values.postgresql.enabled }} env: - - name: FR_INSEE_QUEEN_PERSISTENCE_DATABASE_PASSWORD + - name: SPRING_DATASOURCE_PASSWORD valueFrom: secretKeyRef: name: {{ include "queen.postgresql.fullname" .}} key: password - - name: FR_INSEE_QUEEN_PERSISTENCE_DATABASE_HOST - value: {{ include "queen.postgresql.fullname" . }} - - name: FR_INSEE_QUEEN_PERSISTENCE_DATABASE_USER + - name: SPRING_DATASOURCE_URL + value: {{ printf "jdbc:postgresql://%s:%.0f/%s" (include "queen.postgresql.fullname" .) .Values.postgresql.auth.port .Values.postgresql.auth.database | quote }} + - name: SPRING_DATASOURCE_USERNAME value: {{ .Values.postgresql.auth.username | quote}} - - name: FR_INSEE_QUEEN_PERSISTENCE_DATABASE_SCHEMA - value: {{ .Values.postgresql.auth.database | quote}} {{- end }} {{- if and .Values.api.enabled .Values.api.env }} envFrom: