Allow distruption in single instance postgres
- When PodDisruptionBudget is enabled at the controller level, it creates a PDB even for PostgreSQL deployments with numberOfInstances = 1. This prevents node draining and node rotation, since a single pod cannot meet the disruption requirements. In real HA setups, PostgreSQL should have more than one instance. For single-instance deployments, setting the PDB to minAvailable = 0 avoids unnecessary blocking and makes cluster operations easier to manage.
This commit is contained in:
parent
31f474a95c
commit
ed7bcf4575
|
|
@ -2212,8 +2212,8 @@ func (c *Cluster) generatePodDisruptionBudget() *policyv1.PodDisruptionBudget {
|
|||
pdbEnabled := c.OpConfig.EnablePodDisruptionBudget
|
||||
pdbMasterLabelSelector := c.OpConfig.PDBMasterLabelSelector
|
||||
|
||||
// if PodDisruptionBudget is disabled or if there are no DB pods, set the budget to 0.
|
||||
if (pdbEnabled != nil && !(*pdbEnabled)) || c.Spec.NumberOfInstances <= 0 {
|
||||
// if PodDisruptionBudget is disabled or if there are more than one DB pods, set the budget to 0.
|
||||
if (pdbEnabled != nil && !(*pdbEnabled)) || c.Spec.NumberOfInstances <= 1 {
|
||||
minAvailable = intstr.FromInt(0)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue