Skip to content

Commit 6a08f5b

Browse files
authored
Merge pull request #114 from cybertec-postgresql/PDBImprovements
Pdb improvements
2 parents 5b3b5c2 + cc5439c commit 6a08f5b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/cluster/k8sres.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2812,7 +2812,7 @@ func (c *Cluster) generatePodDisruptionBudget() *policyv1.PodDisruptionBudget {
28122812
pdbEnabled := c.OpConfig.EnablePodDisruptionBudget
28132813

28142814
// if PodDisruptionBudget is disabled or if there are no DB pods, set the budget to 0.
2815-
if (pdbEnabled != nil && !(*pdbEnabled)) || c.Spec.NumberOfInstances <= 0 {
2815+
if (pdbEnabled != nil && !(*pdbEnabled)) || c.Spec.NumberOfInstances <= 1 {
28162816
minAvailable = intstr.FromInt(0)
28172817
}
28182818

@@ -2826,7 +2826,7 @@ func (c *Cluster) generatePodDisruptionBudget() *policyv1.PodDisruptionBudget {
28262826
Spec: policyv1.PodDisruptionBudgetSpec{
28272827
MinAvailable: &minAvailable,
28282828
Selector: &metav1.LabelSelector{
2829-
MatchLabels: c.roleLabelsSet(false, Master),
2829+
MatchLabels: c.labelsSetWithType(false, "postgresql"), //c.roleLabelsSet(false, Master),
28302830
},
28312831
},
28322832
}

0 commit comments

Comments
 (0)