Skip to content

feat(chart): add opt-in PodDisruptionBudget for Longhorn UI - #13378

Merged
derekbit merged 1 commit into
longhorn:masterfrom
somaz94:feat/chart-ui-poddisruptionbudget
Jul 15, 2026
Merged

derekbit merged 1 commit into
longhorn:masterfrom
somaz94:feat/chart-ui-poddisruptionbudget

Conversation

@somaz94

@somaz94 somaz94 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Add an opt-in PodDisruptionBudget for the Longhorn UI Deployment, gated on
longhornUI.podDisruptionBudget.enabled (default false). The UI already defaults
to replicas: 2 with pod anti-affinity, so this lets adopters keep a UI pod
available during voluntary disruptions such as node drains, with no change to
default behavior.

This is the Longhorn UI slice of #12889 (chart PDB gap). Other rendered
Deployments can follow in separate PRs.

Validation (helm lint + helm template, chart 1.12.0-dev):

  • helm lint: 0 chart(s) failed
  • default values: no PodDisruptionBudget rendered
  • podDisruptionBudget.enabled=true: PDB renders with minAvailable: 1
  • enabled=true + maxUnavailable set: PDB renders with maxUnavailable, minAvailable omitted (mutually exclusive)

related: #12889

related: #13466

@somaz94
somaz94 marked this pull request as ready for review June 23, 2026 05:24
@somaz94
somaz94 requested a review from a team as a code owner June 23, 2026 05:24
@COLDTURNIP

Copy link
Copy Markdown
Member

Please remember to update the chart README for the new configurable value podDisruptionBudget

Comment thread chart/templates/poddisruptionbudget-ui.yaml Outdated
@somaz94

somaz94 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, good catch. Pushed a fix using ne (toString ...) "" so maxUnavailable: 0 and minAvailable: 0 are now preserved.

I kept a three-branch form rather than dropping default 1 entirely: if both maxUnavailable and minAvailable are empty, it still falls back to minAvailable: 1 so the rendered PDB stays valid. Verified with helm template for maxUnavailable=0, minAvailable=0, both-empty (→ minAvailable: 1), and 50%; helm lint passes.

@derekbit
derekbit force-pushed the feat/chart-ui-poddisruptionbudget branch from 277e9d3 to 177325d Compare June 27, 2026 04:35
@somaz94
somaz94 force-pushed the feat/chart-ui-poddisruptionbudget branch from 177325d to c1b6cad Compare July 2, 2026 02:30
@somaz94

somaz94 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest master to clear the BEHIND state. The 0-value fix @COLDTURNIP requested is in — the PDB template uses ne (toString $pdb.maxUnavailable) "", so maxUnavailable: 0 / minAvailable: 0 render as-is while the empty-string default still falls back to minAvailable: 1 (verified via helm template). PTAL / could you resolve the thread when you get a chance? Thanks!

@derekbit

derekbit commented Jul 6, 2026

Copy link
Copy Markdown
Member

Hello @somaz94
Thanks for your contribution!
Since #12889 includes several areas, could you create an imporvement ticket in https://github.com/longhorn/longhorn/issues and link it to #12889? It will help manage and validate the improvement. Thanks.

@somaz94

somaz94 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @derekbit! I've opened a dedicated improvement ticket for this UI PDB slice and linked it to #12889:

This PR (#13378) implements that ticket. Happy to adjust the scope or split further if that helps validation/backport. PTAL 🙏

@derekbit
derekbit requested a review from Copilot July 6, 2026 12:16
@derekbit
derekbit force-pushed the feat/chart-ui-poddisruptionbudget branch from c1b6cad to e2951a9 Compare July 6, 2026 12:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an opt-in PodDisruptionBudget (PDB) for the Longhorn UI workload in the Helm chart to improve UI availability during voluntary disruptions (e.g., node drains) without changing default behavior.

Changes:

  • Introduces longhornUI.podDisruptionBudget values (disabled by default) with minAvailable/maxUnavailable support.
  • Adds a new policy/v1 PodDisruptionBudget manifest for the UI, rendered only when enabled.
  • Documents the new values under Longhorn UI settings in the chart README.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
chart/values.yaml Adds new longhornUI.podDisruptionBudget configuration values and defaults.
chart/templates/poddisruptionbudget-ui.yaml New template to render a UI PodDisruptionBudget when enabled.
chart/README.md Documents the new UI PDB values in the configuration table.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread chart/templates/poddisruptionbudget-ui.yaml Outdated
Comment thread chart/README.md Outdated
@derekbit

derekbit commented Jul 6, 2026

Copy link
Copy Markdown
Member

@somaz94 Could you check if the comments from copilot need to be addressed? Thanks.

@somaz94

somaz94 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@derekbit Thanks for the ping — both Copilot comments are addressed in 23518fe:

  1. Single-replica PDB gating — the template now renders only when podDisruptionBudget.enabled and longhornUI.replicas > 1, matching the documented "effective only when replicas > 1" behavior. This avoids creating an always-blocking PDB (minAvailable: 1) that could stall node drains on single-replica setups.
  2. minAvailable type — documented as string (IntOrString) via a helm-docs (string) annotation, so percentage values like "50%" are correctly reflected (consistent with maxUnavailable).

Verified with helm template: replicas=2 renders the PDB, replicas=1 renders nothing, and maxUnavailable: 0 is still preserved. helm lint is clean.

@somaz94
somaz94 force-pushed the feat/chart-ui-poddisruptionbudget branch from 23518fe to 8499f5a Compare July 9, 2026 03:18
@derekbit
derekbit force-pushed the feat/chart-ui-poddisruptionbudget branch from 8499f5a to 621a0d5 Compare July 14, 2026 09:53
@c3y1huang
c3y1huang force-pushed the feat/chart-ui-poddisruptionbudget branch from 621a0d5 to 4c3fe73 Compare July 15, 2026 02:14

@c3y1huang c3y1huang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

Nit: I suggest cleaning up the commit history by folding fixups into the appropriate commits or squashing them before the merge.

@somaz94

somaz94 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@COLDTURNIP @derekbit — I believe everything raised is now addressed; summarizing so the stale review can be re-checked:

No functional changes outstanding on my side — @COLDTURNIP could you take another look when you have a moment? Thanks!

@derekbit

Copy link
Copy Markdown
Member

LGTM.

Nit: I suggest cleaning up the commit history by folding fixups into the appropriate commits or squashing them before the merge.

Hello @somaz94 Could you address the comment? Thank you.

#12889

Signed-off-by: somaz <genius5711@gmail.com>
@somaz94
somaz94 force-pushed the feat/chart-ui-poddisruptionbudget branch from 4c3fe73 to 7466f58 Compare July 15, 2026 05:51
@somaz94

somaz94 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @c3y1huang @derekbit — done. The four commits are now folded into a single commit (7466f58), rebased onto the latest master (this also clears the out-of-date branch state). The net change is unchanged: 3 files, 33 insertions.

Re-verified after the squash with helm lint (0 failed) and helm template:

  • default values → no PDB rendered
  • enabled=trueminAvailable: 1
  • replicas=1 → no PDB rendered (the replicas > 1 gate)
  • maxUnavailable set → minAvailable omitted (mutually exclusive)
  • minAvailable=0 → preserved as 0

@COLDTURNIP the points from your review are addressed in this commit — could you take another look when you get a chance? The CHANGES_REQUESTED from 06-23 predates the fixes and is still blocking the merge.

@c3y1huang
c3y1huang requested a review from COLDTURNIP July 15, 2026 05:58
@mergify

mergify Bot commented Jul 15, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@derekbit
derekbit merged commit 5a34a7f into longhorn:master Jul 15, 2026
6 checks passed
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.

5 participants