Skip to content

feat: Add PodDisruptionBudget support with configuration options#106

Open
SweetOBurritO wants to merge 4 commits intovalkey-io:mainfrom
SweetOBurritO:main
Open

feat: Add PodDisruptionBudget support with configuration options#106
SweetOBurritO wants to merge 4 commits intovalkey-io:mainfrom
SweetOBurritO:main

Conversation

@SweetOBurritO
Copy link

This pull request introduces support for configuring a Kubernetes PodDisruptionBudget (PDB) for Valkey replica deployments, enhancing high availability during voluntary disruptions (such as node drains or rolling updates) requested in #105 . The changes include new configuration options, Helm template logic, documentation updates, schema validation, and comprehensive tests.

PodDisruptionBudget support for high availability:

  • Added a new podDisruptionBudget configuration block in values.yaml to allow enabling/disabling PDB, setting minAvailable or maxUnavailable, and specifying unhealthyPodEvictionPolicy for Valkey replicas.
  • Updated values.schema.json to validate the new podDisruptionBudget fields, supporting both integer and percentage values for minAvailable and maxUnavailable, and restricting unhealthyPodEvictionPolicy to valid options.
  • Created a Helm template poddisruptionbudget.yaml that conditionally generates a PDB resource when both podDisruptionBudget.enabled and replica.enabled are true, applying the configured settings and selector labels.

Documentation updates:

  • Added a "High Availability" section to README.md explaining how to enable and configure PodDisruptionBudget, including usage examples and important notes about its behavior.
  • Extended the configuration table in README.md to document the new podDisruptionBudget fields and their purposes.

Testing:

  • Introduced a new test suite poddisruptionbudget_test.yaml with comprehensive cases to verify correct PDB creation, field precedence, value types, label propagation, and custom name overrides.

Copy link
Collaborator

@sgissi sgissi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work @SweetOBurritO, thanks for the PR. A few nitpicks in my review below, nothing major. Have you already tested that PDB works as intended for both min and max settings?

@SweetOBurritO
Copy link
Author

@sgissi Updated the PR to address your feedback, simplified the documentation and fixed the values comments.

Signed-off-by: Jarred Channer <jarredchanner@gmail.com>
…tion

Signed-off-by: Jarred Channer <jarredchanner@gmail.com>
Signed-off-by: Jarred Channer <jarredchanner@gmail.com>
Signed-off-by: Jarred Channer <jarredchanner@gmail.com>
@amontalban
Copy link
Contributor

Looking forward to have this feature merged in 🙏

@SweetOBurritO
Copy link
Author

Hi @sgissi , just checking in on this PR, I know maintainers are often busy, so no rush.

Would you mind letting me know if there’s any feedback, changes, or additional info needed from my side to help move this forward?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants