Skip to content

Add separate api fields for load balancing specification#1618

Merged
souravbiswassanto merged 14 commits intomasterfrom
add-backend-readreplica
Mar 29, 2026
Merged

Add separate api fields for load balancing specification#1618
souravbiswassanto merged 14 commits intomasterfrom
add-backend-readreplica

Conversation

@HiranmoyChowdhury
Copy link
Copy Markdown
Member

@HiranmoyChowdhury HiranmoyChowdhury commented Mar 3, 2026

there is no way of getting weight other than this. and this requires only because of read replica in postgres(one may not have the same resource as others do)

Signed-off-by: HiranmoyChowdhury hiranmoy@appscode.com

@HiranmoyChowdhury HiranmoyChowdhury changed the title Add Postgres Ready Replica support in Pgpool Add Postgres Read Replica support in Pgpool Mar 3, 2026
@souravbiswassanto souravbiswassanto changed the title Add Postgres Read Replica support in Pgpool Add separate api fields for backend specification Mar 5, 2026
@HiranmoyChowdhury HiranmoyChowdhury changed the title Add separate api fields for backend specification Add separate api fields for load balancing specification Mar 5, 2026
@HiranmoyChowdhury HiranmoyChowdhury force-pushed the add-backend-readreplica branch from 147a61b to cbde6f8 Compare March 5, 2026 10:31
@HiranmoyChowdhury HiranmoyChowdhury force-pushed the add-backend-readreplica branch 2 times, most recently from 1dafc4b to 9c41fe6 Compare March 10, 2026 07:26
Signed-off-by: HiranmoyChowdhury <hiranmoy@appscode.com>
Signed-off-by: HiranmoyChowdhury <hiranmoy@appscode.com>
Signed-off-by: HiranmoyChowdhury <hiranmoy@appscode.com>
Signed-off-by: HiranmoyChowdhury <hiranmoy@appscode.com>
Signed-off-by: HiranmoyChowdhury <hiranmoy@appscode.com>
Signed-off-by: HiranmoyChowdhury <hiranmoy@appscode.com>
Signed-off-by: HiranmoyChowdhury <hiranmoy@appscode.com>
Signed-off-by: HiranmoyChowdhury <hiranmoy@appscode.com>
Signed-off-by: HiranmoyChowdhury <hiranmoy@appscode.com>
Signed-off-by: HiranmoyChowdhury <hiranmoy@appscode.com>
@HiranmoyChowdhury HiranmoyChowdhury force-pushed the add-backend-readreplica branch from f1600df to 92634a8 Compare March 11, 2026 05:00

type PgpoolUpdateBackendSpec struct {
// Sync specifies the list of backends that should be synced with the database.
Sync []v1alpha2.PgpoolLoadBalancingSpec `json:"sync,omitempty"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sync -> backends ?

type PgpoolCustomConfigurationSpec struct {
*ReconfigurationSpec json:",inline,omitempty"
Backends []v1alpha2.PgpoolLoadBalancingSpec json:"backends,omitempty"
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basically like this?

spec:
  configuration:
     backends:
     - hostName: demo.xyz
       weight: 1
       port: 5432
    delete:
      - reporting
      - analytics

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not getting sync -> backends

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basically like this?

spec:
  configuration:
     backends:
     - hostName: demo.xyz
       weight: 1
       port: 5432
    delete:
      - reporting
      - analytics

right.

Copy link
Copy Markdown
Member Author

@HiranmoyChowdhury HiranmoyChowdhury Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just wanna confirm if you want this...
so, this will be like:

spec:
  configuration:
    backends:
    - hostName: demo.xyz
      weight: 1
      port: 5432
    delete:
      - reporting
      - analytics
    configSecret:
      name: secretName
    removeCustomConfig: true

just thought, configuration.delete is a bit unclear...


currently we are doing it like:

spec:
  configuration:
    backend:
      sync:
        - name: demo
          weight: 2
        - name: demo2
          weight: 10
        - name: STANDBY
          weight: 8
      delete:
        - PRIMARY
    removeCustomConfig: true
    configSecret:
      name: pp-custom-config
    applyConfig:
      pgpool.conf: |-
        max_pool = 72
        num_init_children = 9

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe delete -> deleteBackends: ?? @ArnobKumarSaha

Signed-off-by: HiranmoyChowdhury <hiranmoy@appscode.com>
Signed-off-by: HiranmoyChowdhury <hiranmoy@appscode.com>

type PgpoolUpdateBackendSpec struct {
// Sync specifies the list of backends that should be synced with the database.
Sync []v1alpha2.PgpoolLoadBalancingSpec `json:"sync,omitempty"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basically like this?

spec:
  configuration:
     backends:
     - hostName: demo.xyz
       weight: 1
       port: 5432
    delete:
      - reporting
      - analytics

right.

@souravbiswassanto
Copy link
Copy Markdown
Member

  • LGTM. Can't hold this pr. Need to complete this asap. Merging

@souravbiswassanto souravbiswassanto merged commit 0fc180f into master Mar 29, 2026
9 checks passed
@souravbiswassanto souravbiswassanto deleted the add-backend-readreplica branch March 29, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants