Description
The gist of it is to add label couchbase_server=true to PodDisruptionBudget selectors. Bonus - expose custom selectors from CRD to apply to PodDisruptionBudgets.
The Operator internally creates PodDisruptionBudget resources in order to prevent underlying nodes from being decommissioned in a way that would lead to data loss.
Currently the PodDisruption budgets use the basic cluster labels as a selector:
# from policy.go
|
|
required := &policyv1.PodDisruptionBudget{
|
Spec: policyv1.PodDisruptionBudgetSpec{
|
Selector: &metav1.LabelSelector{
|
MatchLabels: LabelsForCluster(cluster),
|
},
|
The problem with this is that these same labels are used with Backup Pods since we merge the two together
# from backup.go
|
|
labels := k8sutil.LabelsForClusterMerged(c.cluster, c.cluster.Spec.Backup.Labels)
|
What happens here is a 3 node cluster has a minimum disruption of 2 (size -1). Now if 2 backup Pods are running, then the PodDisruptionBudget thinks that 4 Pods are active and therefore underlying nodes can be decommissioned, when really we shouldn't be including the backup pods in the count.
Attachments
Issue Links
- blocks
-
K8S-3086 Cloud Native 2.5.0 - Release Notes
- Closed