Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update postgres user password on init #214

Merged
merged 4 commits into from
Dec 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions chart/templates/postgres.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{{- if eq .Values.db.create true }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: postgresql-scripts
data:
post-startup.sh: |
#!/bin/bash
psql -U postgres -c "ALTER USER postgres PASSWORD '${POSTGRES_PASSWORD}';"
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand All @@ -26,6 +35,10 @@ spec:
optional: true
- name: logs
emptyDir: {}
- name: scripts
configMap:
name: postgresql-scripts
defaultMode: 0755

initContainers:
- command:
Expand Down Expand Up @@ -57,6 +70,11 @@ spec:
value: /var/lib/postgresql/data
- name: POSTGRES_DB
value: mission_control
startupProbe:
initialDelaySeconds: 15
exec:
command:
- /post-startup.sh
volumeMounts:
- name: dshm
mountPath: /dev/shm
Expand All @@ -65,6 +83,9 @@ spec:
subPath: postgres
- name: logs
mountPath: /var/log/postgresql
- name: scripts
mountPath: /post-startup.sh
subPath: post-startup.sh
envFrom:
- secretRef:
name: {{ .Values.db.secretKeyRef.name }}
Expand Down
Loading