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

Allow specifying loadBalancerClass #3951

Open
yaraskm opened this issue Jul 3, 2024 · 1 comment
Open

Allow specifying loadBalancerClass #3951

yaraskm opened this issue Jul 3, 2024 · 1 comment

Comments

@yaraskm
Copy link

yaraskm commented Jul 3, 2024

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:

  • Use a mutating admission webhook on the cluster to set the loadBalancerClass if one is not set

OR

  • Create an additional Service object in the namespace and set it's label selectors to point to the desired Pod

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.

  • Platform: Kubernetes
  • Platform Version: 1.26.17
  • PGO Image Tag: ubi8-5.6.0-0
  • Postgres Version: 15

Additional Information

@andrewlecuyer
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants