diff --git a/controllers/pravega_controller.go b/controllers/pravega_controller.go index ea21c901d..7f776c387 100644 --- a/controllers/pravega_controller.go +++ b/controllers/pravega_controller.go @@ -403,7 +403,13 @@ func MakeControllerService(p *api.PravegaCluster) *corev1.Service { } func MakeControllerPodDisruptionBudget(p *api.PravegaCluster) *policyv1beta1.PodDisruptionBudget { - minAvailable := intstr.FromInt(int(p.Spec.Pravega.MaxUnavailableControllerReplicas)) + var maxUnavailable intstr.IntOrString + + if p.Spec.Pravega.MaxUnavailableControllerReplicas == int32(1) { + maxUnavailable = intstr.FromInt(0) + } else { + maxUnavailable = intstr.FromInt(int(p.Spec.Pravega.MaxUnavailableControllerReplicas)) + } return &policyv1beta1.PodDisruptionBudget{ TypeMeta: metav1.TypeMeta{ Kind: "PodDisruptionBudget", @@ -414,7 +420,7 @@ func MakeControllerPodDisruptionBudget(p *api.PravegaCluster) *policyv1beta1.Pod Namespace: p.Namespace, }, Spec: policyv1beta1.PodDisruptionBudgetSpec{ - MinAvailable: &minAvailable, + MaxUnavailable: &maxUnavailable, Selector: &metav1.LabelSelector{ MatchLabels: p.LabelsForController(), },