vitabaks / postgresql_cluster

PostgreSQL High-Availability Cluster (based on Patroni). Automating with Ansible.
https://postgresql-cluster.org
MIT License
1.48k stars 394 forks source link

PostgreSQL Cluster Console (UI/API) #667

Closed vitabaks closed 2 weeks ago

vitabaks commented 3 months ago

Issue: https://github.com/vitabaks/postgresql_cluster/issues/589 Related PR: https://github.com/vitabaks/postgresql_cluster/pull/464

Created with the support of @gslabs-dev

How to run for test

1. Run the Console container

To run the PostgreSQL Cluster Console, execute the following command:

docker run -d --name pg-console \
  --publish 80:80 \
  --publish 8080:8080 \
  --env PG_CONSOLE_API_URL=http://localhost:8080/api/v1 \
  --env PG_CONSOLE_AUTHORIZATION_TOKEN=secret_token \
  --volume console_postgres:/var/lib/postgresql \
  --volume /var/run/docker.sock:/var/run/docker.sock \
  --volume /tmp/ansible:/tmp/ansible \
  --restart=unless-stopped \
  vitabaks/postgresql_cluster_console:console

Note: It is recommended to run the console in the same network as your database servers to enable monitoring of the cluster status. In this case, replace localhost with your server's IP address in the PG_CONSOLE_API_URL variable.

2. Open the Console UI

Open the console UI at the following address: http://localhost \ If you have set up the console on a different server, replace 'localhost' with the server's address.

Use secret_token for authorization, or use the value of your token if you have redefined it in the PG_CONSOLE_AUTHORIZATION_TOKEN variable.