@@ -21,6 +21,7 @@ services:
2121 REPMGR_NODE_NAME : postgres-2
2222 REPMGR_PRIMARY_HOST : ${REPMGR_PRIMARY_HOST}
2323 REPMGR_PARTNER_NODES : ${REPMGR_PARTNER_NODES}
24+ POSTGRESQL_POSTGRES_PASSWORD : ${HAPI_POSTGRES_PASSWORD}
2425 volumes :
2526 - ' hapi-postgres-2-data:/bitnami/postgresql'
2627 deploy :
@@ -37,9 +38,7 @@ services:
3738 memory : ${HF_POSTGRES_MEMORY_RESERVE}
3839 networks :
3940 default :
40- hapi-fhir-postgres :
41- pg_backup_net : {}
42-
41+ pg_backup_net :
4342
4443 postgres-3 :
4544 image : bitnami/postgresql-repmgr:14
@@ -53,6 +52,7 @@ services:
5352 REPMGR_NODE_NAME : postgres-3
5453 REPMGR_PRIMARY_HOST : ${REPMGR_PRIMARY_HOST}
5554 REPMGR_PARTNER_NODES : ${REPMGR_PARTNER_NODES}
55+ POSTGRESQL_POSTGRES_PASSWORD : ${HAPI_POSTGRES_PASSWORD}
5656 volumes :
5757 - ' hapi-postgres-3-data:/bitnami/postgresql'
5858 deploy :
@@ -69,9 +69,131 @@ services:
6969 memory : ${HF_POSTGRES_MEMORY_RESERVE}
7070 networks :
7171 default :
72- hapi-fhir-postgres :
73- pg_backup_net : {}
72+ pg_backup_net :
73+
74+ pgpool-1 :
75+ image : bitnami/pgpool:4.4.3
76+ deploy :
77+ placement :
78+ max_replicas_per_node : 1
79+ resources :
80+ limits :
81+ cpus : ${HF_PGPOOL_CPU_LIMIT}
82+ memory : ${HF_PGPOOL_MEMORY_LIMIT}
83+ reservations :
84+ cpus : ${HF_PGPOOL_CPU_RESERVE}
85+ memory : ${HF_PGPOOL_MEMORY_RESERVE}
86+ configs :
87+ - target : /config/custom_pgpool.conf
88+ source : pgpool.conf
89+ - target : /opt/bitnami/pgpool/conf/pgpool_node_id
90+ source : pgpool_node_id0.conf
91+ environment :
92+ PGPOOL_BACKEND_NODES : ${HF_PGPOOL_NODES}
93+ PGPOOL_BACKEND_APPLICATION_NAMES : ${REPMGR_PARTNER_NODES}
94+ PGPOOL_SR_CHECK_USER : postgres
95+ PGPOOL_SR_CHECK_PASSWORD : ${HAPI_POSTGRES_PASSWORD}
96+ PGPOOL_POSTGRES_USERNAME : postgres
97+ PGPOOL_POSTGRES_PASSWORD : ${HAPI_POSTGRES_PASSWORD}
98+ PGPOOL_ADMIN_USERNAME : ${HF_PGPOOL_USERNAME}
99+ PGPOOL_ADMIN_PASSWORD : ${HF_PGPOOL_PASSWORD}
100+ PGPOOL_POSTGRES_CUSTOM_USERS : ${HF_POSTGRESQL_USERNAME}
101+ PGPOOL_POSTGRES_CUSTOM_PASSWORDS : ${HF_POSTGRESQL_PASSWORD}
102+ PGPOOL_ENABLE_LOAD_BALANCING : " no"
103+ PGPOOL_AUTO_FAILBACK : " yes"
104+ PGPOOL_USER_CONF_FILE : " /config/custom_pgpool.conf"
105+ networks :
106+ default :
107+
108+ pgpool-2 :
109+ image : bitnami/pgpool:4.4.3
110+ deploy :
111+ placement :
112+ max_replicas_per_node : 1
113+ resources :
114+ limits :
115+ cpus : ${HF_PGPOOL_CPU_LIMIT}
116+ memory : ${HF_PGPOOL_MEMORY_LIMIT}
117+ reservations :
118+ cpus : ${HF_PGPOOL_CPU_RESERVE}
119+ memory : ${HF_PGPOOL_MEMORY_RESERVE}
120+ configs :
121+ - target : /config/custom_pgpool.conf
122+ source : pgpool.conf
123+ - target : /opt/bitnami/pgpool/conf/pgpool_node_id
124+ source : pgpool_node_id1.conf
125+ environment :
126+ PGPOOL_BACKEND_NODES : ${HF_PGPOOL_NODES}
127+ PGPOOL_BACKEND_APPLICATION_NAMES : ${REPMGR_PARTNER_NODES}
128+ PGPOOL_SR_CHECK_USER : postgres
129+ PGPOOL_SR_CHECK_PASSWORD : ${HAPI_POSTGRES_PASSWORD}
130+ PGPOOL_POSTGRES_USERNAME : postgres
131+ PGPOOL_POSTGRES_PASSWORD : ${HAPI_POSTGRES_PASSWORD}
132+ PGPOOL_ADMIN_USERNAME : ${HF_PGPOOL_USERNAME}
133+ PGPOOL_ADMIN_PASSWORD : ${HF_PGPOOL_PASSWORD}
134+ PGPOOL_POSTGRES_CUSTOM_USERS : ${HF_POSTGRESQL_USERNAME}
135+ PGPOOL_POSTGRES_CUSTOM_PASSWORDS : ${HF_POSTGRESQL_PASSWORD}
136+ PGPOOL_ENABLE_LOAD_BALANCING : " no"
137+ PGPOOL_AUTO_FAILBACK : " yes"
138+ PGPOOL_USER_CONF_FILE : " /config/custom_pgpool.conf"
139+ networks :
140+ default :
141+
142+ pgpool-3 :
143+ image : bitnami/pgpool:4.4.3
144+ deploy :
145+ placement :
146+ max_replicas_per_node : 1
147+ resources :
148+ limits :
149+ cpus : ${HF_PGPOOL_CPU_LIMIT}
150+ memory : ${HF_PGPOOL_MEMORY_LIMIT}
151+ reservations :
152+ cpus : ${HF_PGPOOL_CPU_RESERVE}
153+ memory : ${HF_PGPOOL_MEMORY_RESERVE}
154+ configs :
155+ - target : /config/custom_pgpool.conf
156+ source : pgpool.conf
157+ - target : /opt/bitnami/pgpool/conf/pgpool_node_id
158+ source : pgpool_node_id2.conf
159+ environment :
160+ PGPOOL_BACKEND_NODES : ${HF_PGPOOL_NODES}
161+ PGPOOL_BACKEND_APPLICATION_NAMES : ${REPMGR_PARTNER_NODES}
162+ PGPOOL_SR_CHECK_USER : postgres
163+ PGPOOL_SR_CHECK_PASSWORD : ${HAPI_POSTGRES_PASSWORD}
164+ PGPOOL_POSTGRES_USERNAME : postgres
165+ PGPOOL_POSTGRES_PASSWORD : ${HAPI_POSTGRES_PASSWORD}
166+ PGPOOL_ADMIN_USERNAME : ${HF_PGPOOL_USERNAME}
167+ PGPOOL_ADMIN_PASSWORD : ${HF_PGPOOL_PASSWORD}
168+ PGPOOL_POSTGRES_CUSTOM_USERS : ${HF_POSTGRESQL_USERNAME}
169+ PGPOOL_POSTGRES_CUSTOM_PASSWORDS : ${HF_POSTGRESQL_PASSWORD}
170+ PGPOOL_ENABLE_LOAD_BALANCING : " no"
171+ PGPOOL_AUTO_FAILBACK : " yes"
172+ PGPOOL_USER_CONF_FILE : " /config/custom_pgpool.conf"
173+ networks :
174+ default :
74175
176+ configs :
177+ pgpool.conf :
178+ name : pgpool_conf-${pgpool_conf_DIGEST:?err}
179+ file : ./config/custom_pgpool.conf
180+ labels :
181+ name : hapi-fhir
182+ pgpool_node_id0.conf :
183+ name : pgpool_node_id0-${pgpool_node_id0_DIGEST:?err}
184+ file : ./config/pgpool_node_id0
185+ labels :
186+ name : hapi-fhir
187+ pgpool_node_id1.conf :
188+ name : pgpool_node_id1-${pgpool_node_id1_DIGEST:?err}
189+ file : ./config/pgpool_node_id1
190+ labels :
191+ name : hapi-fhir
192+ pgpool_node_id2.conf :
193+ name : pgpool_node_id2-${pgpool_node_id2_DIGEST:?err}
194+ file : ./config/pgpool_node_id2
195+ labels :
196+ name : hapi-fhir
75197
76198volumes :
77199 hapi-postgres-2-data :
0 commit comments