From 96bd9c3d990d12dfc5a2c72249030dd1057d4e2c Mon Sep 17 00:00:00 2001 From: Saswata Mukherjee Date: Fri, 1 May 2026 11:17:06 +0100 Subject: [PATCH] ingester/distributor: Ensure PDB is set to maxUnavailable of 1 Signed-off-by: Saswata Mukherjee --- operator/internal/manifests/distributor.go | 4 ++-- operator/internal/manifests/ingester.go | 14 ++------------ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/operator/internal/manifests/distributor.go b/operator/internal/manifests/distributor.go index ca84da93598..00c55d239a7 100644 --- a/operator/internal/manifests/distributor.go +++ b/operator/internal/manifests/distributor.go @@ -236,7 +236,7 @@ func configureDistributorGRPCServicePKI(deployment *appsv1.Deployment, opts Opti // Distributor pods. func newDistributorPodDisruptionBudget(opts Options) *policyv1.PodDisruptionBudget { l := ComponentLabels(LabelDistributorComponent, opts.Name) - mu := intstr.FromInt(1) + maxUnavailable := intstr.FromInt32(1) return &policyv1.PodDisruptionBudget{ TypeMeta: metav1.TypeMeta{ Kind: "PodDisruptionBudget", @@ -251,7 +251,7 @@ func newDistributorPodDisruptionBudget(opts Options) *policyv1.PodDisruptionBudg Selector: &metav1.LabelSelector{ MatchLabels: l, }, - MinAvailable: &mu, + MaxUnavailable: &maxUnavailable, }, } } diff --git a/operator/internal/manifests/ingester.go b/operator/internal/manifests/ingester.go index 0a5b4011072..86b01c469c5 100644 --- a/operator/internal/manifests/ingester.go +++ b/operator/internal/manifests/ingester.go @@ -290,17 +290,7 @@ func configureIngesterGRPCServicePKI(sts *appsv1.StatefulSet, opts Options) erro // Ingester pods. func newIngesterPodDisruptionBudget(opts Options) *policyv1.PodDisruptionBudget { l := ComponentLabels(LabelIngesterComponent, opts.Name) - rf := DefaultLokiStackSpec(opts.Stack.Size).Replication.Factor - if opts.Stack.Replication != nil && opts.Stack.Replication.Factor != 0 { - rf = opts.Stack.Replication.Factor - } - - pdbMinAvailable := rf - if pdbMinAvailable >= opts.Stack.Template.Ingester.Replicas { - pdbMinAvailable = max(1, opts.Stack.Template.Ingester.Replicas-1) - } - minAvailable := intstr.FromInt32(pdbMinAvailable) - + maxUnavailable := intstr.FromInt32(1) return &policyv1.PodDisruptionBudget{ TypeMeta: metav1.TypeMeta{ Kind: "PodDisruptionBudget", @@ -315,7 +305,7 @@ func newIngesterPodDisruptionBudget(opts Options) *policyv1.PodDisruptionBudget Selector: &metav1.LabelSelector{ MatchLabels: l, }, - MinAvailable: &minAvailable, + MaxUnavailable: &maxUnavailable, }, } }