You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create the second PDB to cover Pods with a special "critical operation" label set.
This label is going to be assigned to all pg cluster's Pods by the Operator during a PG major version upgrade, by Patroni during a cluster/replica bootstrap. It can also be set manually or by any other automation tool.
Copy file name to clipboardExpand all lines: docs/administrator.md
+21-9
Original file line number
Diff line number
Diff line change
@@ -620,22 +620,34 @@ By default the topology key for the pod anti affinity is set to
620
620
`kubernetes.io/hostname`, you can set another topology key e.g.
621
621
`failure-domain.beta.kubernetes.io/zone`. See [built-in node labels](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#interlude-built-in-node-labels) for available topology keys.
622
622
623
-
## Pod Disruption Budget
623
+
## Pod Disruption Budgets
624
624
625
-
By default the operator uses a PodDisruptionBudget (PDB) to protect the cluster
626
-
from voluntarily disruptions and hence unwanted DB downtime. The `MinAvailable`
627
-
parameter of the PDB is set to `1` which prevents killing masters in single-node
628
-
clusters and/or the last remaining running instance in a multi-node cluster.
625
+
By default the operator creates two PodDisruptionBudgets (PDB) to protect the cluster
626
+
from voluntarily disruptions and hence unwanted DB downtime: so-called primary PDB and
627
+
and PDB for critical operations.
628
+
629
+
### Primary PDB
630
+
The `MinAvailable` parameter of this PDB is set to `1` and, if `pdb_master_label_selector`
631
+
is enabled, label selector includes `spilo-role=master` condition, which prevents killing
632
+
masters in single-node clusters and/or the last remaining running instance in a multi-node
633
+
cluster.
634
+
635
+
## PDB for critical operations
636
+
The `MinAvailable` parameter of this PDB is equal to the `numberOfInstances` set in the
637
+
cluster manifest, while label selector includes `critical-operation=true` condition. This
638
+
allows to protect all pods of a cluster, given they are labeled accordingly.
639
+
For example, Operator labels all Spilo pods with `critical-operation=true` during the major
640
+
version upgrade run. You may want to protect cluster pods during other critical operations
641
+
by assigning the label to pods yourself or using other means of automation.
629
642
630
643
The PDB is only relaxed in two scenarios:
631
644
632
645
* If a cluster is scaled down to `0` instances (e.g. for draining nodes)
633
646
* If the PDB is disabled in the configuration (`enable_pod_disruption_budget`)
634
647
635
-
The PDB is still in place having `MinAvailable` set to `0`. If enabled it will
636
-
be automatically set to `1` on scale up. Disabling PDBs helps avoiding blocking
637
-
Kubernetes upgrades in managed K8s environments at the cost of prolonged DB
638
-
downtime. See PR [#384](https://github.com/zalando/postgres-operator/pull/384)
648
+
The PDBs are still in place having `MinAvailable` set to `0`. Disabling PDBs
649
+
helps avoiding blocking Kubernetes upgrades in managed K8s environments at the
650
+
cost of prolonged DB downtime. See PR [#384](https://github.com/zalando/postgres-operator/pull/384)
0 commit comments