PodDisruptionBudget creation fails when maxUnavailable is set due to default minAvailable conflict
search cancel

PodDisruptionBudget creation fails when maxUnavailable is set due to default minAvailable conflict

book

Article ID: 437667

calendar_today

Updated On:

Products

VMware Tanzu Data Suite VMware Tanzu for Valkey

Issue/Introduction

When configuring PodDisruptionBudget (PDB) for ValkeyReplication using ValkeySentinel.spec.valkeyReplicationConfig.podDisruptionBudget.maxUnavailable, users may observe that the operator fails to create the PDB resource and logs an error similar to:

ERROR operator.controllers.ValkeyReplication failed to create the pod disruption budget for master pod
{"error": "PodDisruptionBudget.policy \"<instance-name>-master\" is invalid:
spec: Invalid value: policy.PodDisruptionBudgetSpec{
  MinAvailable:1,
  Selector:{...},
  MaxUnavailable:1
}: minAvailable and maxUnavailable cannot be both set"}
This occurs even when only maxUnavailable is explicitly defined in the ValkeySentinel specification.

As a result:

  • PodDisruptionBudget is not created successfully
  • Operator logs show validation errors
  • Users are unable to control disruption behavior using maxUnavailable

Cause

This issue occurs because:

  • The operator sets minAvailable by default for master pods
  • When a user explicitly configures maxUnavailable, both values are present in the final PDB specification
  • Kubernetes does not allow both minAvailable and maxUnavailable to be set simultaneously

This results in a validation failure when creating the PodDisruptionBudget.

Resolution

Workaround:

  • Remove the maxUnavailable from the PDB configuration if you have set it and allow the operator to manage the default minAvailable setting

Permanent Fix:

  • This has been fixed in v3.4.0.