cloudnative-pg / charts

CloudNativePG Helm Charts
Apache License 2.0
175 stars 83 forks source link

[Feature] Add nodeSelector to support cluster pods distribution among node group instances #248

Closed samialitop3 closed 4 months ago

samialitop3 commented 6 months ago

When deploying to k8s cluster with a node group that has instances, there should be support for selecting the node group that the cluster pods will be deployed to, to make sure the pods are deployed on the desired instances for HA.

itay-grudev commented 5 months ago

Can you not achieve this by adding affinity rules to your cluster configuration?

See the CNPG Scheduling documentation.

samialitop3 commented 5 months ago

I can use affinity but here is the catch, I have more than one node group, so the cluster will be scheduling to other node groups in case I am doing replacement for the current node group that I want to the database cluster to be working on.

itay-grudev commented 4 months ago

The cluster.affinity is proxied to ClusterSpec.AffinityConfiguration. There you have the ability to set nodeSelector as well.