Skip to content

Add PodDisruptionBudget to Helm chart with minAvailable: 1#16

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1776850989-add-pdb-to-helm-chart
Open

Add PodDisruptionBudget to Helm chart with minAvailable: 1#16
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1776850989-add-pdb-to-helm-chart

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a PodDisruptionBudget resource to the ordermanager Helm chart with minAvailable: 1 as the default. The PDB uses the chart's existing helper templates for naming and label selectors, consistent with other resources in the chart.

Changes:

  • New template helm/ordermanager/templates/pdb.yamlpolicy/v1 PDB matching the deployment's selector labels
  • Default podDisruptionBudget.minAvailable: 1 added to values.yaml

Review & Testing Checklist for Human

  • Dev environment blocking: With replicaCount: 1 (the default, and values-dev.yaml), minAvailable: 1 will block all voluntary evictions (node drains, cluster upgrades) since K8s cannot evict the only pod. Consider whether dev/single-replica environments should skip the PDB or use minAvailable: 0. You may want to add an enabled flag or override minAvailable in values-dev.yaml.
  • Template correctness: Run helm template and helm lint against the chart to verify the PDB renders correctly with each values file (values.yaml, values-dev.yaml, values-staging.yaml).
  • Kubernetes version: The policy/v1 API requires Kubernetes ≥ 1.21. Confirm target clusters meet this requirement.

Notes

  • The PDB is unconditionally created (no enabled toggle). Other resources in this chart like ingress and autoscaling use an enabled flag — you may want to follow the same pattern here for consistency.
  • Related context: this was requested alongside an inventory microservice decomposition in app_dotnet-angular-monolith (PR #275).

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/ee5d89c412b84c479a8a6b0bfc01d2e2


Open in Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 1 additional finding in Devin Review.

Open in Devin Review

Comment on lines +49 to +50
podDisruptionBudget:
minAvailable: 1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🔴 PDB with minAvailable=1 and replicaCount=1 blocks all voluntary disruptions

With replicaCount: 1 (helm/ordermanager/values.yaml:1) and podDisruptionBudget.minAvailable: 1, the PDB will prevent Kubernetes from ever voluntarily evicting the single pod. During node drains (e.g., cluster upgrades, node maintenance), Kubernetes checks if evicting a pod would violate the PDB. Since evicting the only replica would bring available pods from 1 to 0, which is below minAvailable: 1, the eviction is blocked indefinitely. This is a well-known Kubernetes anti-pattern that will cause node drain operations to hang or time out.

Prompt for agents
The PDB minAvailable: 1 combined with replicaCount: 1 (values.yaml:1) means the PDB will block all voluntary pod evictions (node drains, cluster upgrades, etc.) since Kubernetes cannot evict the only replica without violating the budget.

Possible fixes:
1. Change to maxUnavailable: 1 instead of minAvailable: 1 in both the values.yaml and pdb.yaml template. This allows one pod to be unavailable during disruptions, which works with any replica count.
2. Increase replicaCount to at least 2 so that one pod can be evicted while still satisfying minAvailable: 1.
3. Add an enabled flag to podDisruptionBudget (like other optional resources in this chart) and disable it by default when replicaCount is 1.

The template at helm/ordermanager/templates/pdb.yaml would need to be updated if approach 1 is chosen, changing spec.minAvailable to spec.maxUnavailable.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

0 participants