Add PostgreSQL deployment tooling and release validation

This commit is contained in:
Lyncoln
2026-09-17 11:10:52 -04:00
parent bfd2e1e7b2
commit 71f5537782
8 changed files with 896 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
[Unit]
Description=PostgreSQL HA Maintenance Container
[Container]
Volume=/home/david/.local/libexec/postgres-ha-peer-config.sh:/usr/local/libexec/postgres-ha-peer-config.sh:ro,Z
ContainerName=postgres
Image=docker.io/library/postgres@sha256:4ef4dbc939d61acea57712655ddb4b4ab27419c913f94cca0cd57cb3ea3c2280
Entrypoint=/usr/local/sbin/postgres-ha-bootstrap
Exec=sleep infinity
RunInit=true
StopSignal=SIGTERM
StopTimeout=5
Network=postgres.network
PublishPort=5432:5432
Volume=postgres-data:/var/lib/postgresql:Z
Volume=/home/david/.local/libexec/postgres-ha-bootstrap:/usr/local/sbin/postgres-ha-bootstrap:ro,Z
Volume=/home/david/.config/postgres-ha/secrets:/run/secrets/postgres-ha:ro,Z
EnvironmentFile=/home/david/.config/postgres-ha/postgres.env
[Service]
SuccessExitStatus=143
Restart=on-abnormal
TimeoutStartSec=0
+25
View File
@@ -0,0 +1,25 @@
PGDATA=/var/lib/postgresql/18/docker
# Initial bootstrap role. Pacemaker/RA controls promotion afterward.
POSTGRES_HA_MODE=standby
POSTGRES_REPLICATION_USER=replicator
# Node-specific values:
POSTGRES_NODE_NAME=CHANGE_ME
POSTGRES_APPLICATION_NAME=CHANGE_ME
POSTGRES_REPLICATION_SLOT=ha_pg_CHANGE_ME
# Stable cluster peer map:
POSTGRES_REPLICATION_PEERS=david-prodesk=192.168.1.4:5432,david-macbookpro=192.168.1.5:5432,david-eve=192.168.1.3:5432
# Initial/bootstrap upstream. The RA later determines the elected primary.
POSTGRES_PRIMARY_HOST=192.168.1.4
POSTGRES_PRIMARY_PORT=5432
POSTGRES_HA_SLOTS=ha_pg_david_macbookpro,ha_pg_david_eve,ha_pg_david_prodesk
# Secret contents are never stored here.
POSTGRES_REPLICATION_PASSWORD_FILE=/run/secrets/postgres-ha/replication_password
POSTGRES_HA_REPLICATION_NETWORKS=192.168.1.3/32,192.168.1.4/32,192.168.1.5/32,10.89.0.0/16