refactor: Remove initContainers from PostgreSQL StatefulSet and enable default configuration settings

This commit is contained in:
Simon Larsen
2025-09-07 12:17:13 +01:00
parent e1046d2424
commit 26b085030d
2 changed files with 3 additions and 26 deletions

View File

@@ -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 }}"

View File

@@ -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