diff --git a/.chloggen/fix-pdb-defaulting-logic.yaml b/.chloggen/fix-pdb-defaulting-logic.yaml
new file mode 100755
index 0000000000..ef94571620
--- /dev/null
+++ b/.chloggen/fix-pdb-defaulting-logic.yaml
@@ -0,0 +1,16 @@
+# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
+change_type: bug_fix
+
+# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
+component: collector
+
+# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
+note: Fixes a bug where the operator would default the PDB in the wrong place.
+
+# One or more tracking issues related to the change
+issues: [3198]
+
+# (Optional) One or more lines of additional information to render under the primary note.
+# These lines will be padded with 2 spaces and then inserted directly into the document.
+# Use pipe (|) for multiline entries.
+subtext:
diff --git a/apis/v1beta1/collector_webhook.go b/apis/v1beta1/collector_webhook.go
index 8374615a88..92c91e8360 100644
--- a/apis/v1beta1/collector_webhook.go
+++ b/apis/v1beta1/collector_webhook.go
@@ -22,7 +22,6 @@ import (
"github.com/go-logr/logr"
autoscalingv2 "k8s.io/api/autoscaling/v2"
"k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/util/validation"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
@@ -92,35 +91,6 @@ func (c CollectorWebhook) Default(_ context.Context, obj runtime.Object) error {
}
}
- // if pdb isn't provided, we set MaxUnavailable 1,
- // which will work even if there is just one replica,
- // not blocking node drains but preventing out-of-the-box
- // from disruption generated by them with replicas > 1
- if otelcol.Spec.PodDisruptionBudget == nil {
- otelcol.Spec.PodDisruptionBudget = &PodDisruptionBudgetSpec{
- MaxUnavailable: &intstr.IntOrString{
- Type: intstr.Int,
- IntVal: 1,
- },
- }
- }
-
- // if pdb isn't provided for target allocator and it's enabled
- // using a valid strategy (consistent-hashing, per-node),
- // we set MaxUnavailable 1, which will work even if there is
- // just one replica, not blocking node drains but preventing
- // out-of-the-box from disruption generated by them with replicas > 1
- if otelcol.Spec.TargetAllocator.Enabled &&
- otelcol.Spec.TargetAllocator.AllocationStrategy != TargetAllocatorAllocationStrategyLeastWeighted &&
- otelcol.Spec.TargetAllocator.PodDisruptionBudget == nil {
- otelcol.Spec.TargetAllocator.PodDisruptionBudget = &PodDisruptionBudgetSpec{
- MaxUnavailable: &intstr.IntOrString{
- Type: intstr.Int,
- IntVal: 1,
- },
- }
- }
-
if otelcol.Spec.Ingress.Type == IngressTypeRoute && otelcol.Spec.Ingress.Route.Termination == "" {
otelcol.Spec.Ingress.Route.Termination = TLSRouteTerminationTypeEdge
}
diff --git a/apis/v1beta1/collector_webhook_test.go b/apis/v1beta1/collector_webhook_test.go
index bfc5c6e095..805861aea0 100644
--- a/apis/v1beta1/collector_webhook_test.go
+++ b/apis/v1beta1/collector_webhook_test.go
@@ -120,12 +120,6 @@ func TestCollectorDefaultingWebhook(t *testing.T) {
Args: map[string]string{"feature-gates": "-component.UseLocalHostAsDefaultHost"},
ManagementState: ManagementStateManaged,
Replicas: &one,
- PodDisruptionBudget: &PodDisruptionBudgetSpec{
- MaxUnavailable: &intstr.IntOrString{
- Type: intstr.Int,
- IntVal: 1,
- },
- },
},
Mode: ModeDeployment,
UpgradeStrategy: UpgradeStrategyAutomatic,
@@ -156,12 +150,6 @@ func TestCollectorDefaultingWebhook(t *testing.T) {
Args: map[string]string{"feature-gates": "-component.UseLocalHostAsDefaultHost"},
Replicas: &five,
ManagementState: ManagementStateManaged,
- PodDisruptionBudget: &PodDisruptionBudgetSpec{
- MaxUnavailable: &intstr.IntOrString{
- Type: intstr.Int,
- IntVal: 1,
- },
- },
},
},
},
@@ -191,12 +179,6 @@ func TestCollectorDefaultingWebhook(t *testing.T) {
Args: map[string]string{"feature-gates": "-component.UseLocalHostAsDefaultHost"},
Replicas: &five,
ManagementState: ManagementStateUnmanaged,
- PodDisruptionBudget: &PodDisruptionBudgetSpec{
- MaxUnavailable: &intstr.IntOrString{
- Type: intstr.Int,
- IntVal: 1,
- },
- },
},
},
},
@@ -224,12 +206,6 @@ func TestCollectorDefaultingWebhook(t *testing.T) {
Args: map[string]string{"feature-gates": "-component.UseLocalHostAsDefaultHost"},
Replicas: &one,
ManagementState: ManagementStateManaged,
- PodDisruptionBudget: &PodDisruptionBudgetSpec{
- MaxUnavailable: &intstr.IntOrString{
- Type: intstr.Int,
- IntVal: 1,
- },
- },
},
Autoscaler: &AutoscalerSpec{
TargetCPUUtilization: &defaultCPUTarget,
@@ -261,12 +237,6 @@ func TestCollectorDefaultingWebhook(t *testing.T) {
Args: map[string]string{"feature-gates": "-component.UseLocalHostAsDefaultHost"},
ManagementState: ManagementStateManaged,
Replicas: &one,
- PodDisruptionBudget: &PodDisruptionBudgetSpec{
- MaxUnavailable: &intstr.IntOrString{
- Type: intstr.Int,
- IntVal: 1,
- },
- },
},
Ingress: Ingress{
Type: IngressTypeRoute,
@@ -345,12 +315,6 @@ func TestCollectorDefaultingWebhook(t *testing.T) {
Args: map[string]string{"feature-gates": "-component.UseLocalHostAsDefaultHost"},
Replicas: &one,
ManagementState: ManagementStateManaged,
- PodDisruptionBudget: &PodDisruptionBudgetSpec{
- MaxUnavailable: &intstr.IntOrString{
- Type: intstr.Int,
- IntVal: 1,
- },
- },
},
UpgradeStrategy: UpgradeStrategyAutomatic,
TargetAllocator: TargetAllocatorEmbedded{
@@ -396,12 +360,6 @@ func TestCollectorDefaultingWebhook(t *testing.T) {
Args: map[string]string{"feature-gates": "-component.UseLocalHostAsDefaultHost"},
Replicas: &one,
ManagementState: ManagementStateManaged,
- PodDisruptionBudget: &PodDisruptionBudgetSpec{
- MaxUnavailable: &intstr.IntOrString{
- Type: intstr.Int,
- IntVal: 1,
- },
- },
},
UpgradeStrategy: UpgradeStrategyAutomatic,
TargetAllocator: TargetAllocatorEmbedded{
@@ -442,24 +400,12 @@ func TestCollectorDefaultingWebhook(t *testing.T) {
Args: map[string]string{"feature-gates": "-component.UseLocalHostAsDefaultHost"},
Replicas: &one,
ManagementState: ManagementStateManaged,
- PodDisruptionBudget: &PodDisruptionBudgetSpec{
- MaxUnavailable: &intstr.IntOrString{
- Type: intstr.Int,
- IntVal: 1,
- },
- },
},
UpgradeStrategy: UpgradeStrategyAutomatic,
TargetAllocator: TargetAllocatorEmbedded{
Enabled: true,
Replicas: &one,
AllocationStrategy: TargetAllocatorAllocationStrategyConsistentHashing,
- PodDisruptionBudget: &PodDisruptionBudgetSpec{
- MaxUnavailable: &intstr.IntOrString{
- Type: intstr.Int,
- IntVal: 1,
- },
- },
},
},
},
@@ -487,12 +433,6 @@ func TestCollectorDefaultingWebhook(t *testing.T) {
Args: map[string]string{"feature-gates": "-component.UseLocalHostAsDefaultHost"},
Replicas: &one,
ManagementState: ManagementStateManaged,
- PodDisruptionBudget: &PodDisruptionBudgetSpec{
- MaxUnavailable: &intstr.IntOrString{
- Type: intstr.Int,
- IntVal: 1,
- },
- },
},
UpgradeStrategy: UpgradeStrategyAutomatic,
TargetAllocator: TargetAllocatorEmbedded{
diff --git a/apis/v1beta1/common.go b/apis/v1beta1/common.go
index 7aa341dade..cf31de5118 100644
--- a/apis/v1beta1/common.go
+++ b/apis/v1beta1/common.go
@@ -116,7 +116,8 @@ type OpenTelemetryCommonFields struct {
// +optional
Replicas *int32 `json:"replicas,omitempty"`
// PodDisruptionBudget specifies the pod disruption budget configuration to use
- // for the generated workload.
+ // for the generated workload. By default, a PDB with a MaxUnavailable of one is set.
+ //
// +optional
PodDisruptionBudget *PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
// SecurityContext configures the container security context for
diff --git a/apis/v1beta1/opentelemetrycollector_types.go b/apis/v1beta1/opentelemetrycollector_types.go
index 8d4740fd18..dd20af943d 100644
--- a/apis/v1beta1/opentelemetrycollector_types.go
+++ b/apis/v1beta1/opentelemetrycollector_types.go
@@ -216,7 +216,8 @@ type TargetAllocatorEmbedded struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Observability"
Observability ObservabilitySpec `json:"observability,omitempty"`
// PodDisruptionBudget specifies the pod disruption budget configuration to use
- // for the target allocator workload.
+ // for the target allocator workload. By default, a PDB with a MaxUnavailable of one is set for a valid
+ // allocation strategy.
//
// +optional
PodDisruptionBudget *PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
diff --git a/controllers/builder_test.go b/controllers/builder_test.go
index f8959d99cb..2c5070fa84 100644
--- a/controllers/builder_test.go
+++ b/controllers/builder_test.go
@@ -26,6 +26,7 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
+ policyV1 "k8s.io/api/policy/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
@@ -222,6 +223,38 @@ service:
},
},
},
+ &policyV1.PodDisruptionBudget{
+ TypeMeta: metav1.TypeMeta{},
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "test-collector",
+ Namespace: "test",
+ Labels: map[string]string{
+ "app.kubernetes.io/component": "opentelemetry-collector",
+ "app.kubernetes.io/instance": "test.test",
+ "app.kubernetes.io/managed-by": "opentelemetry-operator",
+ "app.kubernetes.io/name": "test-collector",
+ "app.kubernetes.io/part-of": "opentelemetry",
+ "app.kubernetes.io/version": "latest",
+ },
+ Annotations: map[string]string{},
+ },
+ Spec: policyV1.PodDisruptionBudgetSpec{
+ Selector: &v1.LabelSelector{
+ MatchLabels: map[string]string{
+ "app.kubernetes.io/component": "opentelemetry-collector",
+ "app.kubernetes.io/instance": "test.test",
+ "app.kubernetes.io/managed-by": "opentelemetry-operator",
+ "app.kubernetes.io/name": "test-collector",
+ "app.kubernetes.io/part-of": "opentelemetry",
+ "app.kubernetes.io/version": "latest",
+ },
+ },
+ MaxUnavailable: &intstr.IntOrString{
+ Type: intstr.Int,
+ IntVal: 1,
+ },
+ },
+ },
&corev1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Name: "test-collector-" + goodConfigHash,
@@ -468,6 +501,38 @@ service:
},
},
},
+ &policyV1.PodDisruptionBudget{
+ TypeMeta: metav1.TypeMeta{},
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "test-collector",
+ Namespace: "test",
+ Labels: map[string]string{
+ "app.kubernetes.io/component": "opentelemetry-collector",
+ "app.kubernetes.io/instance": "test.test",
+ "app.kubernetes.io/managed-by": "opentelemetry-operator",
+ "app.kubernetes.io/name": "test-collector",
+ "app.kubernetes.io/part-of": "opentelemetry",
+ "app.kubernetes.io/version": "latest",
+ },
+ Annotations: map[string]string{},
+ },
+ Spec: policyV1.PodDisruptionBudgetSpec{
+ Selector: &v1.LabelSelector{
+ MatchLabels: map[string]string{
+ "app.kubernetes.io/component": "opentelemetry-collector",
+ "app.kubernetes.io/instance": "test.test",
+ "app.kubernetes.io/managed-by": "opentelemetry-operator",
+ "app.kubernetes.io/name": "test-collector",
+ "app.kubernetes.io/part-of": "opentelemetry",
+ "app.kubernetes.io/version": "latest",
+ },
+ },
+ MaxUnavailable: &intstr.IntOrString{
+ Type: intstr.Int,
+ IntVal: 1,
+ },
+ },
+ },
&corev1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Name: "test-collector-" + goodConfigHash,
@@ -750,6 +815,38 @@ service:
},
},
},
+ &policyV1.PodDisruptionBudget{
+ TypeMeta: metav1.TypeMeta{},
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "test-collector",
+ Namespace: "test",
+ Labels: map[string]string{
+ "app.kubernetes.io/component": "opentelemetry-collector",
+ "app.kubernetes.io/instance": "test.test",
+ "app.kubernetes.io/managed-by": "opentelemetry-operator",
+ "app.kubernetes.io/name": "test-collector",
+ "app.kubernetes.io/part-of": "opentelemetry",
+ "app.kubernetes.io/version": "latest",
+ },
+ Annotations: map[string]string{},
+ },
+ Spec: policyV1.PodDisruptionBudgetSpec{
+ Selector: &v1.LabelSelector{
+ MatchLabels: map[string]string{
+ "app.kubernetes.io/component": "opentelemetry-collector",
+ "app.kubernetes.io/instance": "test.test",
+ "app.kubernetes.io/managed-by": "opentelemetry-operator",
+ "app.kubernetes.io/name": "test-collector",
+ "app.kubernetes.io/part-of": "opentelemetry",
+ "app.kubernetes.io/version": "latest",
+ },
+ },
+ MaxUnavailable: &intstr.IntOrString{
+ Type: intstr.Int,
+ IntVal: 1,
+ },
+ },
+ },
&corev1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Name: "test-collector-" + goodConfigHash,
@@ -1163,8 +1260,9 @@ service:
Mode: "statefulset",
Config: goodConfig,
TargetAllocator: v1beta1.TargetAllocatorEmbedded{
- Enabled: true,
- FilterStrategy: "relabel-config",
+ Enabled: true,
+ FilterStrategy: "relabel-config",
+ AllocationStrategy: v1beta1.TargetAllocatorAllocationStrategyConsistentHashing,
PrometheusCR: v1beta1.TargetAllocatorPrometheusCR{
Enabled: true,
},
@@ -1276,6 +1374,38 @@ service:
PodManagementPolicy: "Parallel",
},
},
+ &policyV1.PodDisruptionBudget{
+ TypeMeta: metav1.TypeMeta{},
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "test-collector",
+ Namespace: "test",
+ Labels: map[string]string{
+ "app.kubernetes.io/component": "opentelemetry-collector",
+ "app.kubernetes.io/instance": "test.test",
+ "app.kubernetes.io/managed-by": "opentelemetry-operator",
+ "app.kubernetes.io/name": "test-collector",
+ "app.kubernetes.io/part-of": "opentelemetry",
+ "app.kubernetes.io/version": "latest",
+ },
+ Annotations: map[string]string{},
+ },
+ Spec: policyV1.PodDisruptionBudgetSpec{
+ Selector: &v1.LabelSelector{
+ MatchLabels: map[string]string{
+ "app.kubernetes.io/component": "opentelemetry-collector",
+ "app.kubernetes.io/instance": "test.test",
+ "app.kubernetes.io/managed-by": "opentelemetry-operator",
+ "app.kubernetes.io/name": "test-collector",
+ "app.kubernetes.io/part-of": "opentelemetry",
+ "app.kubernetes.io/version": "latest",
+ },
+ },
+ MaxUnavailable: &intstr.IntOrString{
+ Type: intstr.Int,
+ IntVal: 1,
+ },
+ },
+ },
&corev1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Name: "test-collector-" + goodConfigHash,
@@ -1530,6 +1660,39 @@ prometheus_cr:
Selector: taSelectorLabels,
},
},
+ &policyV1.PodDisruptionBudget{
+ TypeMeta: metav1.TypeMeta{},
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "test-targetallocator",
+ Namespace: "test",
+ Labels: map[string]string{
+ "app.kubernetes.io/component": "opentelemetry-targetallocator",
+ "app.kubernetes.io/instance": "test.test",
+ "app.kubernetes.io/managed-by": "opentelemetry-operator",
+ "app.kubernetes.io/name": "test-targetallocator",
+ "app.kubernetes.io/part-of": "opentelemetry",
+ "app.kubernetes.io/version": "latest",
+ },
+ Annotations: map[string]string{
+ "opentelemetry-targetallocator-config/hash": "9d78d2ecfad18bad24dec7e9a825b4ce45657ecbb2e6b32845b585b7c15ea407",
+ },
+ },
+ Spec: policyV1.PodDisruptionBudgetSpec{
+ Selector: &v1.LabelSelector{
+ MatchLabels: map[string]string{
+ "app.kubernetes.io/component": "opentelemetry-targetallocator",
+ "app.kubernetes.io/instance": "test.test",
+ "app.kubernetes.io/managed-by": "opentelemetry-operator",
+ "app.kubernetes.io/name": "test-targetallocator",
+ "app.kubernetes.io/part-of": "opentelemetry",
+ },
+ },
+ MaxUnavailable: &intstr.IntOrString{
+ Type: intstr.Int,
+ IntVal: 1,
+ },
+ },
+ },
},
wantErr: false,
},
@@ -1553,7 +1716,8 @@ prometheus_cr:
PrometheusCR: v1beta1.TargetAllocatorPrometheusCR{
Enabled: true,
},
- FilterStrategy: "relabel-config",
+ AllocationStrategy: v1beta1.TargetAllocatorAllocationStrategyConsistentHashing,
+ FilterStrategy: "relabel-config",
Observability: v1beta1.ObservabilitySpec{
Metrics: v1beta1.MetricsConfigSpec{
EnableMetrics: true,
@@ -1667,6 +1831,38 @@ prometheus_cr:
PodManagementPolicy: "Parallel",
},
},
+ &policyV1.PodDisruptionBudget{
+ TypeMeta: metav1.TypeMeta{},
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "test-collector",
+ Namespace: "test",
+ Labels: map[string]string{
+ "app.kubernetes.io/component": "opentelemetry-collector",
+ "app.kubernetes.io/instance": "test.test",
+ "app.kubernetes.io/managed-by": "opentelemetry-operator",
+ "app.kubernetes.io/name": "test-collector",
+ "app.kubernetes.io/part-of": "opentelemetry",
+ "app.kubernetes.io/version": "latest",
+ },
+ Annotations: map[string]string{},
+ },
+ Spec: policyV1.PodDisruptionBudgetSpec{
+ Selector: &v1.LabelSelector{
+ MatchLabels: map[string]string{
+ "app.kubernetes.io/component": "opentelemetry-collector",
+ "app.kubernetes.io/instance": "test.test",
+ "app.kubernetes.io/managed-by": "opentelemetry-operator",
+ "app.kubernetes.io/name": "test-collector",
+ "app.kubernetes.io/part-of": "opentelemetry",
+ "app.kubernetes.io/version": "latest",
+ },
+ },
+ MaxUnavailable: &intstr.IntOrString{
+ Type: intstr.Int,
+ IntVal: 1,
+ },
+ },
+ },
&corev1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Name: "test-collector-" + goodConfigHash,
@@ -1921,6 +2117,39 @@ prometheus_cr:
Selector: taSelectorLabels,
},
},
+ &policyV1.PodDisruptionBudget{
+ TypeMeta: metav1.TypeMeta{},
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "test-targetallocator",
+ Namespace: "test",
+ Labels: map[string]string{
+ "app.kubernetes.io/component": "opentelemetry-targetallocator",
+ "app.kubernetes.io/instance": "test.test",
+ "app.kubernetes.io/managed-by": "opentelemetry-operator",
+ "app.kubernetes.io/name": "test-targetallocator",
+ "app.kubernetes.io/part-of": "opentelemetry",
+ "app.kubernetes.io/version": "latest",
+ },
+ Annotations: map[string]string{
+ "opentelemetry-targetallocator-config/hash": "9d78d2ecfad18bad24dec7e9a825b4ce45657ecbb2e6b32845b585b7c15ea407",
+ },
+ },
+ Spec: policyV1.PodDisruptionBudgetSpec{
+ Selector: &v1.LabelSelector{
+ MatchLabels: map[string]string{
+ "app.kubernetes.io/component": "opentelemetry-targetallocator",
+ "app.kubernetes.io/instance": "test.test",
+ "app.kubernetes.io/managed-by": "opentelemetry-operator",
+ "app.kubernetes.io/name": "test-targetallocator",
+ "app.kubernetes.io/part-of": "opentelemetry",
+ },
+ },
+ MaxUnavailable: &intstr.IntOrString{
+ Type: intstr.Int,
+ IntVal: 1,
+ },
+ },
+ },
&monitoringv1.ServiceMonitor{
ObjectMeta: metav1.ObjectMeta{
Name: "test-targetallocator",
diff --git a/controllers/reconcile_test.go b/controllers/reconcile_test.go
index 20e5e0822b..46b0d38837 100644
--- a/controllers/reconcile_test.go
+++ b/controllers/reconcile_test.go
@@ -416,8 +416,8 @@ func TestOpenTelemetryCollectorReconciler_Reconcile(t *testing.T) {
{
name: "policy v1 deployment collector",
args: args{
- params: testCollectorWithPDB(1, 0),
- updates: []v1alpha1.OpenTelemetryCollector{testCollectorWithPDB(0, 1)},
+ params: testCollectorWithModeAndReplicas("policytest", v1alpha1.ModeDeployment, 3),
+ updates: []v1alpha1.OpenTelemetryCollector{testCollectorWithPDB(1, 0)},
},
want: []want{
{
@@ -427,8 +427,8 @@ func TestOpenTelemetryCollectorReconciler_Reconcile(t *testing.T) {
actual := policyV1.PodDisruptionBudget{}
exists, pdbErr := populateObjectIfExists(t, &actual, namespacedObjectName(naming.HorizontalPodAutoscaler(params.Name), params.Namespace))
assert.NoError(t, pdbErr)
- assert.Equal(t, int32(1), actual.Spec.MinAvailable.IntVal)
- assert.Nil(t, actual.Spec.MaxUnavailable)
+ assert.Equal(t, int32(1), actual.Spec.MaxUnavailable.IntVal)
+ assert.Nil(t, actual.Spec.MinAvailable)
assert.True(t, exists)
},
},
@@ -442,8 +442,8 @@ func TestOpenTelemetryCollectorReconciler_Reconcile(t *testing.T) {
actual := policyV1.PodDisruptionBudget{}
exists, pdbErr := populateObjectIfExists(t, &actual, namespacedObjectName(naming.HorizontalPodAutoscaler(params.Name), params.Namespace))
assert.NoError(t, pdbErr)
- assert.Nil(t, actual.Spec.MinAvailable)
- assert.Equal(t, int32(1), actual.Spec.MaxUnavailable.IntVal)
+ assert.Nil(t, actual.Spec.MaxUnavailable)
+ assert.Equal(t, int32(1), actual.Spec.MinAvailable.IntVal)
assert.True(t, exists)
},
},
diff --git a/docs/api.md b/docs/api.md
index 7c756d98b8..103258832f 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -31031,7 +31031,7 @@ the generated pods.
object |
PodDisruptionBudget specifies the pod disruption budget configuration to use
-for the target allocator workload. +for the target allocator workload. By default, a PDB with a MaxUnavailable of one is set for a valid +allocation strategy. |
false |