status-db: add PostgreSQL DB configuration

https://github.com/status-im/infra-status/issues/37

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2023-11-23 12:46:19 +01:00
parent f7c4b8a788
commit 10437a6c97
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
3 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,22 @@
---
postgres_ha_service_name: 'nim-waku-db'
postgres_ha_cont_image: 'postgres:15.1-alpine'
postgres_ha_cont_port: 5432
postgres_ha_is_master: true
postgres_ha_replica_enabled: false
postgres_ha_admin_user: 'postgres'
postgres_ha_admin_pass: '{{lookup("bitwarden", "fleets/status/"+stage+"/db/admin")}}'
postgres_ha_databases:
- name: 'nim-waku'
user: 'nim-waku'
pass: '{{lookup("bitwarden", "fleets/status/"+stage+"/db/nim-waku")}}'
# Open PostgreSQL Port
open_ports_default_comment: '{{ postgres_ha_service_name }}'
open_ports_default_chain: 'SERVICES'
open_ports_default_protocol: 'tcp'
open_ports_list:
- { port: '{{ postgres_ha_cont_port }}', ipset: '{{ env }}.{{ stage }}' }

View File

@ -23,6 +23,11 @@ nim_waku_rpc_tcp_addr: 0.0.0.0
# Limits
nim_waku_p2p_max_connections: 200
# Store
nim_waku_store_message_db_host: 'db-01.do-ams3.status.test.wg'
nim_waku_store_message_db_name: 'nim-waku'
nim_waku_store_message_db_user: 'nim-waku'
nim_waku_store_message_db_pass: '{{lookup("bitwarden", "fleets/status/"+stage+"/db/nim-waku")}}'
nim_waku_store_message_db_url: 'postgres://{{ nim_waku_store_message_db_user}}:{{ nim_waku_store_message_db_pass}}@{{ nim_waku_store_message_db_host }}:5432/{{nim_waku_store_message_db_name}}'
nim_waku_store_message_retention_policy: '{{ (stage == "test") | ternary("size:15GB", "time:2592000") }}' # 14 or 30 days
# Requires too much disk and takes too long.
nim_waku_store_vacuum: false

View File

@ -17,3 +17,11 @@
- { role: infra-role-swap-file, tags: swap-file }
- { role: infra-role-certbot, tags: certbot }
- { role: infra-role-nim-waku, tags: nim-waku }
- name: Configure PostgreSQL DB
hosts: status-db
serial: '{{ serial|default(3) }}'
roles:
- { role: infra-role-open-ports, tags: open-ports }
- { role: infra-role-swap-file, tags: swap-file }
- { role: infra-role-postgres-ha, tags: postgres-ha }