diff --git a/charts/mint/Chart.yaml b/charts/mint/Chart.yaml index 65bc43c..3d62d42 100644 --- a/charts/mint/Chart.yaml +++ b/charts/mint/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: 3.3.1-alpha.0 +version: 3.3.1-alpha.1 # 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 # follow Semantic Versioning. They should reflect the version the application is using. diff --git a/charts/mint/templates/hasura.yaml b/charts/mint/templates/hasura.yaml index 584d88c..1e84752 100644 --- a/charts/mint/templates/hasura.yaml +++ b/charts/mint/templates/hasura.yaml @@ -75,6 +75,8 @@ spec: secretKeyRef: name: {{ include "mint.prefix" . }}-hasura-secrets key: jwt_secret + - name: DB_HOST + value: {{ include "mint.prefix" $ }}-hasura ports: - name: http containerPort: 8080 @@ -84,9 +86,11 @@ spec: path: / port: http readinessProbe: - httpGet: - path: / - port: http + exec: + command: + - /bin/sh + - -c + - pg_isready -h localhost -p 5432 - name: hasura-db #if the values.arm_support is true, then use the arm_image, otherwise use the image {{- if .Values.arm_support }} diff --git a/charts/mint/templates/post-install-hasura.yaml b/charts/mint/templates/post-install-hasura.yaml index ac0c5d7..97cb0db 100644 --- a/charts/mint/templates/post-install-hasura.yaml +++ b/charts/mint/templates/post-install-hasura.yaml @@ -20,10 +20,26 @@ spec: helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" spec: restartPolicy: Never + initContainers: + - name: wait-for-db + image: busybox + command: ['sh', '-c', 'until nc -z ${DB_HOST} 5432; do echo waiting for db; sleep 2; done;'] + env: + - name: DB_HOST + value: {{ include "mint.prefix" $ }}-hasura + - name: DB_PORT + value: "5432" + - name: DB_NAME + value: ALL + - name: DB_USER + valueFrom: + secretKeyRef: + name: {{ include "mint.prefix" . }}-hasura-secrets + key: username containers: - name: post-install-hasura command: ["/bin/bash"] - args: ["-c", "env && hasura migrate apply && hasura metadata apply && hasura seeds apply"] + args: ["-c", "env && pushd /hasura && hasura migrate apply && hasura metadata apply && hasura seeds apply"] {{- with .Values.components.hasura }} image: "{{ .image.repository }}:{{ .image.tag | default $.Chart.AppVersion }}" resources: diff --git a/charts/mint/values.yaml b/charts/mint/values.yaml index 80ee5b3..2b3f9a6 100644 --- a/charts/mint/values.yaml +++ b/charts/mint/values.yaml @@ -158,7 +158,7 @@ components: enabled: true image: repository: mintproject/graphql-engine - tag: 0fc7ce2a5098d2e86f1280f6fa70acfc816a531d + tag: 305c0dbeba1878eafe348f21fc300fbfc017d9dc pullPolicy: IfNotPresent resources: {} environment: