Add PodDisruptionBudget to Helm chart with minAvailable: 1#16
Add PodDisruptionBudget to Helm chart with minAvailable: 1#16devin-ai-integration[bot] wants to merge 1 commit into
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| podDisruptionBudget: | ||
| minAvailable: 1 |
There was a problem hiding this comment.
🔴 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Adds a
PodDisruptionBudgetresource to the ordermanager Helm chart withminAvailable: 1as the default. The PDB uses the chart's existing helper templates for naming and label selectors, consistent with other resources in the chart.Changes:
helm/ordermanager/templates/pdb.yaml—policy/v1PDB matching the deployment's selector labelspodDisruptionBudget.minAvailable: 1added tovalues.yamlReview & Testing Checklist for Human
replicaCount: 1(the default, andvalues-dev.yaml),minAvailable: 1will 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 useminAvailable: 0. You may want to add anenabledflag or overrideminAvailableinvalues-dev.yaml.helm templateandhelm lintagainst the chart to verify the PDB renders correctly with each values file (values.yaml,values-dev.yaml,values-staging.yaml).policy/v1API requires Kubernetes ≥ 1.21. Confirm target clusters meet this requirement.Notes
enabledtoggle). Other resources in this chart likeingressandautoscalinguse anenabledflag — you may want to follow the same pattern here for consistency.app_dotnet-angular-monolith(PR #275).Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/ee5d89c412b84c479a8a6b0bfc01d2e2