Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Patroni REST API endpoint configuration and custom tag support #586

Closed
vitabaks opened this issue Feb 28, 2024 · 0 comments
Closed

Add Patroni REST API endpoint configuration and custom tag support #586

vitabaks opened this issue Feb 28, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request sponsor's request

Comments

@vitabaks
Copy link
Owner

vitabaks commented Feb 28, 2024

I am currently working on a PostgreSQL cluster setup that spans across multiple data centers. We use a setup with HAProxy load balancers in each data center to manage local and cross-data center traffic. Our goal is to optimize traffic within local data centers while maintaining failover capabilities between them.

To better support our multi-data center setup, we are looking into enhancing our automation to provide more granular control over database endpoint configurations and load balancing. Specifically, we are interested in:

  1. Endpoint Configuration in Patroni REST API: We need the automation to support custom configurations for Patroni REST API endpoints. This is crucial for defining different behaviors based on the data center context, such as directing read traffic primarily within the same data center.

  2. Custom Tag Support for Load Balancing: We would like to introduce the capability to add custom tags in the endpoint configurations. For example, by adding datacenter=<name> or region=<name> to the endpoint configuration, we could ensure that load balancing is only considering replicas within the same local data center, thereby excluding servers from a remote data center or region.

This feature would address scenarios where a multi-data center setup starts from one location and expands, allowing for a more flexible and efficient database management strategy across different geographical locations.

The desired outcome is to allow for configuration like the following in the automation setup:

  • GET /replica?datacenter=dc1 or /replica?datacenter=dc2 for directing read traffic based on the data center.
  • Support for defining custom tags at the host or host group level in the automation scripts, which would then be used to filter eligible nodes for load balancing.

Documentation: https://patroni.readthedocs.io/en/latest/rest_api.html#health-check-endpoints

This enhancement would significantly improve our database management's efficiency and flexibility across multiple data centers, ensuring better performance and failover support.


Consider sponsoring the project via GitHub or Patreon

@vitabaks vitabaks added enhancement New feature or request sponsor's request labels Feb 28, 2024
@vitabaks vitabaks self-assigned this Feb 28, 2024
@vitabaks vitabaks changed the title Add Patroni REST API endpoint configuration and custom tag support TODO: Add Patroni REST API endpoint configuration and custom tag support Feb 28, 2024
@vitabaks vitabaks changed the title TODO: Add Patroni REST API endpoint configuration and custom tag support Add Patroni REST API endpoint configuration and custom tag support Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request sponsor's request
Projects
None yet
Development

No branches or pull requests

1 participant