From 1430078c1fcab77461ab1d2034358f53f08083d0 Mon Sep 17 00:00:00 2001 From: ljupcovangelski Date: Sat, 27 Jul 2024 21:25:23 +0200 Subject: [PATCH] [#4179] Fix postgresql statefulset --- infrastructure/helm-chart/charts/tools/Chart.yaml | 6 +++++- .../charts/postgresql/templates/statefulset.yaml | 15 +++++++++++++++ .../charts/tools/charts/postgresql/values.yaml | 2 +- .../charts/tools/charts/redis/values.yaml | 1 + 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/infrastructure/helm-chart/charts/tools/Chart.yaml b/infrastructure/helm-chart/charts/tools/Chart.yaml index 35381f023c..355c3888aa 100644 --- a/infrastructure/helm-chart/charts/tools/Chart.yaml +++ b/infrastructure/helm-chart/charts/tools/Chart.yaml @@ -7,4 +7,8 @@ dependencies: - name: akhq condition: akhq.enabled - name: kafka-connect - condition: kafka-connect.enabled \ No newline at end of file + condition: kafka-connect.enabled + - name: postgresql + condition: postgresql.enabled + - name: redis + condition: redis.enabled \ No newline at end of file diff --git a/infrastructure/helm-chart/charts/tools/charts/postgresql/templates/statefulset.yaml b/infrastructure/helm-chart/charts/tools/charts/postgresql/templates/statefulset.yaml index 75ceafab64..c8532d058c 100644 --- a/infrastructure/helm-chart/charts/tools/charts/postgresql/templates/statefulset.yaml +++ b/infrastructure/helm-chart/charts/tools/charts/postgresql/templates/statefulset.yaml @@ -16,6 +16,18 @@ spec: app: {{ .Values.name }} spec: terminationGracePeriodSeconds: 10 + initContainers: + - command: + - sh + - -c + - rmdir /var/lib/postgresql/data/lost+found + image: ghcr.io/airyhq/infrastructure/busybox:latest + imagePullPolicy: IfNotPresent + name: fix-new-directory + resources: {} + volumeMounts: + - mountPath: /var/lib/postgresql/data + name: {{ .Values.name }}-data containers: - name: {{ .Values.name }} image: {{ .Values.image }}:{{ .Values.version }} @@ -38,6 +50,9 @@ spec: successThreshold: 1 failureThreshold: 5 resources: {{ .Values.resources }} + volumeMounts: + - mountPath: /var/lib/postgresql/data + name: {{ .Values.name }}-data volumeClaimTemplates: - metadata: name: {{ .Values.name }}-data diff --git a/infrastructure/helm-chart/charts/tools/charts/postgresql/values.yaml b/infrastructure/helm-chart/charts/tools/charts/postgresql/values.yaml index 8f203dfb68..cdadf02ce6 100644 --- a/infrastructure/helm-chart/charts/tools/charts/postgresql/values.yaml +++ b/infrastructure/helm-chart/charts/tools/charts/postgresql/values.yaml @@ -1,6 +1,6 @@ name: postgresql mandatory: false -enabled: true +enabled: false image: postgres version: 15.1 port: 5432 diff --git a/infrastructure/helm-chart/charts/tools/charts/redis/values.yaml b/infrastructure/helm-chart/charts/tools/charts/redis/values.yaml index 3de6277432..21f389ee20 100644 --- a/infrastructure/helm-chart/charts/tools/charts/redis/values.yaml +++ b/infrastructure/helm-chart/charts/tools/charts/redis/values.yaml @@ -1,3 +1,4 @@ +enabled: false version: 7.0.8 port: 6379 storage: "5Gi"