From 26b085030d673c22d1d92d9df84f85ff3c02ee09 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Sun, 7 Sep 2025 12:17:13 +0100 Subject: [PATCH] refactor: Remove initContainers from PostgreSQL StatefulSet and enable default configuration settings --- .../templates/postgresql-statefulset.yaml | 22 ------------------- HelmChart/Public/oneuptime/values.yaml | 7 +++--- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/HelmChart/Public/oneuptime/templates/postgresql-statefulset.yaml b/HelmChart/Public/oneuptime/templates/postgresql-statefulset.yaml index 3903bd576c..4bc1555f60 100644 --- a/HelmChart/Public/oneuptime/templates/postgresql-statefulset.yaml +++ b/HelmChart/Public/oneuptime/templates/postgresql-statefulset.yaml @@ -48,28 +48,6 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} {{- end }} - initContainers: - - name: setup-config - image: busybox:latest - command: - - sh - - -c - - | - # Create the postgresql.conf symlink if it doesn't exist and the bitnami config exists - if [ -f "/var/lib/postgresql/data/postgresql/pgdata/postgresql.conf" ] && [ ! -f "/var/lib/postgresql/data/data/postgresql.conf" ]; then - ln -sf ../postgresql/pgdata/postgresql.conf /var/lib/postgresql/data/data/postgresql.conf - fi - # Also link pg_hba.conf if it exists - if [ -f "/var/lib/postgresql/data/postgresql/pgdata/pg_hba.conf" ] && [ ! -f "/var/lib/postgresql/data/data/pg_hba.conf" ]; then - ln -sf ../postgresql/pgdata/pg_hba.conf /var/lib/postgresql/data/data/pg_hba.conf - fi - # Also link pg_ident.conf if it exists - if [ -f "/var/lib/postgresql/data/postgresql/pgdata/pg_ident.conf" ] && [ ! -f "/var/lib/postgresql/data/data/pg_ident.conf" ]; then - ln -sf ../postgresql/pgdata/pg_ident.conf /var/lib/postgresql/data/data/pg_ident.conf - fi - volumeMounts: - - name: data - mountPath: /var/lib/postgresql/data containers: - name: postgresql image: "{{ .Values.postgresql.image.repository }}:{{ .Values.postgresql.image.tag }}" diff --git a/HelmChart/Public/oneuptime/values.yaml b/HelmChart/Public/oneuptime/values.yaml index 081b02f079..6a3b972052 100644 --- a/HelmChart/Public/oneuptime/values.yaml +++ b/HelmChart/Public/oneuptime/values.yaml @@ -83,10 +83,9 @@ postgresql: tolerations: [] affinity: {} resources: {} - # Optional PostgreSQL configuration - # configuration: |- - # max_connections = 100 - # shared_buffers = 128MB + configuration: |- + max_connections = 100 + shared_buffers = 128MB # effective_cache_size = 4GB # maintenance_work_mem = 64MB # checkpoint_completion_target = 0.9