CrunchyData / postgres-operator

Production PostgreSQL for Kubernetes, from high availability Postgres clusters to full-scale database-as-a-service.
https://access.crunchydata.com/documentation/postgres-operator/v5/
Apache License 2.0
3.92k stars 592 forks source link

Allow specifying loadBalancerClass #3951

Open yaraskm opened 3 months ago

yaraskm commented 3 months ago

Overview

When exposing a Service of type LoadBalancer, it can be useful to set the .spec.loadBalancerClass field in case there are multiple implementations in the cluster and none of them are set as the default.

Use Case

Say that you're trying to expose the primary replica via a LoadBalancer. Currently, there is no field in the PostgresClusters spec to set additional properties, such as loadBalancerClass. If this can't be set via the PostgresClusters object, then the options are either:

OR

Desired Behavior

The PostgresClusters CRD, and any other resource that allows creating a Service of type LoadBalancer, should allow setting the loadBalancerClass and propagating this onto the generated Service object(s).

Environment

Environment agnostic, but in our case we're using multiple copies of MetalLB to provide multiple LoadBalancer implementations, without a default set for the cluster.

Additional Information

andrewlecuyer commented 3 months ago

Hi @yaraskm, thanks for the feature request! I went ahead and added a story for configuring loadBalancerClass to the CPK backlog.