Skip to content

Add support for loadBalancerClass in LoadBalancer services#3083

Open
raphaeltorquat0 wants to merge 1 commit into
zalando:masterfrom
raphaeltorquat0:feature/loadbalancer-class-support
Open

Add support for loadBalancerClass in LoadBalancer services#3083
raphaeltorquat0 wants to merge 1 commit into
zalando:masterfrom
raphaeltorquat0:feature/loadbalancer-class-support

Conversation

@raphaeltorquat0
Copy link
Copy Markdown

What this PR does

This adds a new configuration option load_balancer_class that allows users to specify which load balancer provider should handle the service when running multiple providers in the same cluster.

Fixes #2600

Changes

  • Added load_balancer_class field to LoadBalancerConfiguration struct
  • Added config mapping in importConfigurationFromCRD()
  • Modified configureLoadBalanceService() to set spec.loadBalancerClass when configured
  • Updated CRD schema with new field
  • Updated default configuration manifest
  • Added documentation

Example usage

apiVersion: acid.zalan.do/v1
kind: OperatorConfiguration
metadata:
  name: postgres-operator
configuration:
  load_balancer:
    enable_master_load_balancer: true
    load_balancer_class: "service.k8s.aws/nlb"

Type of change

  • New feature (non-breaking change which adds functionality)

Note: parts of this implementation were developed with AI assistance.

This adds a new configuration option `load_balancer_class` that allows
users to specify which load balancer provider should handle the service
when running multiple providers in the same cluster.

The setting can be configured globally via the OperatorConfiguration
CRD and will be applied to all LoadBalancer services (master, replica,
and connection pooler services).

Fixes zalando#2600
@raphaeltorquat0
Copy link
Copy Markdown
Author

Hi! Could a maintainer please add the appropriate label to this PR? I believe minor would be suitable as this adds a new non-breaking feature. Thank you!

@FxKu
Copy link
Copy Markdown
Member

FxKu commented Apr 29, 2026

To use NLBs we usually do it via serviceAnnotations - begs the question if we really need another option. Plus, how would you get two LBs? Is the old LB with other class not dropped when you switch the class?

  serviceAnnotations:
    service.beta.kubernetes.io/aws-load-balancer-type: nlb
    service.beta.kubernetes.io/aws-load-balancer-internal: "true"

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.

Support setting loadBalancerClass for loadbalancer services

2 participants