From d6183841cc0fcb6948ddbddd8dd4af3e327eccf7 Mon Sep 17 00:00:00 2001 From: Joydip Bhattacharyya Date: Sat, 4 Oct 2025 16:38:12 +0530 Subject: [PATCH] :sparkles: enabled flag added in helm chart and postgres templates --- .../templates/postgres/postgres-headless-service.yaml | 4 +++- .../helm/syft/templates/postgres/postgres-secret.yaml | 4 +++- .../helm/syft/templates/postgres/postgres-service.yaml | 4 +++- .../syft/templates/postgres/postgres-statefuleset.yaml | 8 +++++--- packages/grid/helm/syft/values.yaml | 2 ++ 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/grid/helm/syft/templates/postgres/postgres-headless-service.yaml b/packages/grid/helm/syft/templates/postgres/postgres-headless-service.yaml index 4855a7868ff..6e9fda451ac 100644 --- a/packages/grid/helm/syft/templates/postgres/postgres-headless-service.yaml +++ b/packages/grid/helm/syft/templates/postgres/postgres-headless-service.yaml @@ -1,3 +1,4 @@ +{{- if .Values.postgres.enabled }} apiVersion: v1 kind: Service metadata: @@ -12,4 +13,5 @@ spec: port: 5432 selector: {{- include "common.selectorLabels" . | nindent 4 }} - app.kubernetes.io/component: postgres \ No newline at end of file + app.kubernetes.io/component: postgres +{{- end }} \ No newline at end of file diff --git a/packages/grid/helm/syft/templates/postgres/postgres-secret.yaml b/packages/grid/helm/syft/templates/postgres/postgres-secret.yaml index 63a990c0d9a..35332acf801 100644 --- a/packages/grid/helm/syft/templates/postgres/postgres-secret.yaml +++ b/packages/grid/helm/syft/templates/postgres/postgres-secret.yaml @@ -1,3 +1,4 @@ +{{- if .Values.postgres.enabled }} {{- $secretName := "postgres-secret" }} apiVersion: v1 kind: Secret @@ -14,4 +15,5 @@ data: "randomDefault" .Values.global.randomizedSecrets "default" .Values.postgres.secret.rootPassword "context" $) - }} \ No newline at end of file + }} +{{- end }} \ No newline at end of file diff --git a/packages/grid/helm/syft/templates/postgres/postgres-service.yaml b/packages/grid/helm/syft/templates/postgres/postgres-service.yaml index 9cd8b156bdd..fa061c231e3 100644 --- a/packages/grid/helm/syft/templates/postgres/postgres-service.yaml +++ b/packages/grid/helm/syft/templates/postgres/postgres-service.yaml @@ -1,3 +1,4 @@ +{{- if .Values.postgres.enabled }} apiVersion: v1 kind: Service metadata: @@ -14,4 +15,5 @@ spec: - name: postgres port: 5432 protocol: TCP - targetPort: 5432 \ No newline at end of file + targetPort: 5432 +{{- end }} \ No newline at end of file diff --git a/packages/grid/helm/syft/templates/postgres/postgres-statefuleset.yaml b/packages/grid/helm/syft/templates/postgres/postgres-statefuleset.yaml index 986031b17e9..f4995d6610d 100644 --- a/packages/grid/helm/syft/templates/postgres/postgres-statefuleset.yaml +++ b/packages/grid/helm/syft/templates/postgres/postgres-statefuleset.yaml @@ -1,3 +1,4 @@ +{{- if .Values.postgres.enabled }} apiVersion: apps/v1 kind: StatefulSet metadata: @@ -45,9 +46,9 @@ spec: key: rootPassword - name: POSTGRES_DB value: {{ .Values.postgres.dbname | required "postgres.dbname is required" | quote }} - {{- if .Values.postgres.env }} - {{- toYaml .Values.postgres.env | nindent 12 }} - {{- end }} + {{- if .Values.postgres.env }} + {{- toYaml .Values.postgres.env | nindent 12 }} + {{- end }} volumeMounts: - mountPath: tmp/data/db name: postgres-data @@ -69,4 +70,5 @@ spec: resources: requests: storage: {{ .Values.postgres.storageSize | quote }} +{{- end }} diff --git a/packages/grid/helm/syft/values.yaml b/packages/grid/helm/syft/values.yaml index 2eab0b20f67..f31c6b73156 100644 --- a/packages/grid/helm/syft/values.yaml +++ b/packages/grid/helm/syft/values.yaml @@ -15,6 +15,7 @@ global: # ================================================================================= postgres: + enabled: true # Postgres config port: 5432 username: syft_postgres @@ -52,6 +53,7 @@ frontend: # Pod Resource Limits resourcesPreset: medium + postgres: resources: null # =================================================================================