Skip to content

Commit c7a586d

Browse files
authoredMar 10, 2025
Configure (upcoming) Patroni bootstrap labels feature (#2872)
Set the value from the critical-operation-pdb's selector if PDBs are enabled
1 parent 746df0d commit c7a586d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎pkg/cluster/k8sres.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,9 @@ func (c *Cluster) generateSpiloPodEnvVars(
10101010

10111011
if c.patroniUsesKubernetes() {
10121012
envVars = append(envVars, v1.EnvVar{Name: "DCS_ENABLE_KUBERNETES_API", Value: "true"})
1013+
if c.OpConfig.EnablePodDisruptionBudget != nil && !(*c.OpConfig.EnablePodDisruptionBudget) {
1014+
envVars = append(envVars, v1.EnvVar{Name: "KUBERNETES_BOOTSTRAP_LABELS", Value: "{\"critical-operation\":\"true\"}"})
1015+
}
10131016
} else {
10141017
envVars = append(envVars, v1.EnvVar{Name: "ETCD_HOST", Value: c.OpConfig.EtcdHost})
10151018
}

0 commit comments

Comments
 (0)