fix: improve PostgreSQL initialization and authentication - Add startup probe for PostgreSQL - Update authentication to use scram-sha-256 consistently - Add better logging for database operations - Improve migration job initialization checks
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 6m2s
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 6m2s
This commit is contained in:
parent
55feccec4b
commit
e5d7a52e59
@ -14,7 +14,15 @@ spec:
|
||||
- name: wait-for-postgres
|
||||
image: postgres:15
|
||||
command: ['sh', '-c',
|
||||
'until pg_isready -h postgres-service -p 5432 -U prod_admin; do echo waiting for postgres; sleep 2; done;']
|
||||
'echo "Waiting for PostgreSQL to be ready..." && \
|
||||
for i in $(seq 1 30); do \
|
||||
if pg_isready -h postgres-service -p 5432 -U prod_admin; then \
|
||||
echo "PostgreSQL is ready!" && exit 0; \
|
||||
fi; \
|
||||
echo "Attempt $i: PostgreSQL is not ready yet. Waiting..." && \
|
||||
sleep 10; \
|
||||
done; \
|
||||
echo "PostgreSQL failed to become ready in time" && exit 1;']
|
||||
env:
|
||||
- name: PGPASSWORD
|
||||
value: "{{ .Values.backend.env.POSTGRES_PASSWORD }}"
|
||||
|
@ -8,7 +8,7 @@ data:
|
||||
local all all trust
|
||||
host all all 127.0.0.1/32 trust
|
||||
host all all ::1/128 trust
|
||||
host all all 0.0.0.0/0 md5
|
||||
host all all 0.0.0.0/0 scram-sha-256
|
||||
postgresql.conf: |
|
||||
# Connection Settings
|
||||
listen_addresses = '*'
|
||||
@ -48,4 +48,11 @@ data:
|
||||
# Other Settings
|
||||
dynamic_shared_memory_type = posix
|
||||
effective_io_concurrency = 200
|
||||
default_statistics_target = 100
|
||||
default_statistics_target = 100
|
||||
|
||||
# Authentication
|
||||
password_encryption = scram-sha-256
|
||||
|
||||
# Error Reporting
|
||||
log_min_error_statement = error
|
||||
log_statement = 'all'
|
@ -24,6 +24,37 @@ spec:
|
||||
value: "{{ .Values.postgres.user }}"
|
||||
- name: POSTGRES_PASSWORD
|
||||
value: "{{ .Values.postgres.password }}"
|
||||
- name: POSTGRES_HOST_AUTH_METHOD
|
||||
value: "scram-sha-256"
|
||||
startupProbe:
|
||||
exec:
|
||||
command:
|
||||
- pg_isready
|
||||
- -U
|
||||
- "{{ .Values.postgres.user }}"
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
failureThreshold: 30
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- pg_isready
|
||||
- -U
|
||||
- "{{ .Values.postgres.user }}"
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 5
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- pg_isready
|
||||
- -U
|
||||
- "{{ .Values.postgres.user }}"
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
volumeMounts:
|
||||
- mountPath: /var/lib/postgresql/data
|
||||
name: postgres-data
|
||||
|
Loading…
Reference in New Issue
Block a user