reactive-tech / kubegres

Kubegres is a Kubernetes operator allowing to deploy one or many clusters of PostgreSql instances and manage databases replication, failover and backup.
https://www.kubegres.io
Apache License 2.0
1.31k stars 74 forks source link

Specific nodeAffinity to only primary #157

Open bastoune opened 1 year ago

bastoune commented 1 year ago

Hello,

Hi would like to update the Kubegres statefulSet, but only the primary one. Is it possible from the kubegres.reactive-tech.io/v1 resource ?

Basically, i would like to apply this spec:

      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - weight: 1
            preference:
              matchExpressions:
              - key: k8s.scaleway.com/dedicated-cpu
                operator: In
                values:
                - "true"

I want to keep the fact the replicats are in PodAntiAffinity with the Primary. But i want the primary to prefer being deployed on the k8s.scaleway.com/dedicated-cpu labelled node.

alex-arica commented 10 months ago

Thank you for your message.

This feature is not available in Kubegres.

It is a good idea and it could be implemented.

We are very low in dev resources at the moment, if you manage to implement it I can approve the PR.