percona-postgresql-operator icon indicating copy to clipboard operation
percona-postgresql-operator copied to clipboard

Possibility to specify loadBalancerClass for the exposed services

Open zentavr opened this issue 1 year ago • 1 comments

Proposal

It would be great to be able to specify '/spec/loadBalancerClass' value when setting up a service exposure. We have several load balancer and MetallB catch only the configuration which is specified with that field.

Use-Case

No response

Is this a feature you are interested in implementing yourself?

No

Anything else?

no

zentavr avatar Aug 28 '24 00:08 zentavr

As a workaround you can install kubemod operator inside your cluster and patch the service on the fly, like:

---
apiVersion: api.kubemod.io/v1beta1
kind: ModRule
metadata:
  name: zabbix-database-pgbouncer-svc-mod
  namespace: zabbix
spec:
  type: Patch

  match:
    # Match Services ...
    - select: '$.kind'
      matchValue: Service
    - select: '$.metadata.name'
      matchValue: zabbix-database-pgbouncer

    # ... created by the percona operator.
    - select: '$.metadata.labels["app.kubernetes.io/component"]'
      matchValue: pgbouncer
    - select: '$.metadata.labels["app.kubernetes.io/instance"]'
      matchValue: zabbix-database
    - select: '$.metadata.labels["app.kubernetes.io/managed-by"]'
      matchValue: percona-postgresql-operator

  patch:
    # Add custom annotation.
    - op: add
      path: /spec/loadBalancerClass
      value: metallb

zentavr avatar Aug 28 '24 01:08 zentavr

@zentavr it was added under https://perconadev.atlassian.net/browse/K8SPG-752 task. It will be available in PGO 2.8.0

hors avatar Jul 25 '25 15:07 hors

Hi @zentavr , I’m happy to inform you that PGO 2.8.0 has been released! 🎉 You can find the release notes here: https://docs.percona.com/percona-operator-for-postgresql/2.0/ReleaseNotes/Kubernetes-Operator-for-PostgreSQL-RN2.8.0.html

hors avatar Nov 13 '25 16:11 hors