Skip to content

Commit 6b1cb4b

Browse files
committed
fix: Update pod disruption budget logic to prevent simultaneous use of minAvailable and maxUnavailable
1 parent fe4aa04 commit 6b1cb4b

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

helm/polaris/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ ct install --namespace polaris --charts ./helm/polaris
314314
| podDisruptionBudget | object | `{"annotations":{},"enabled":false,"maxUnavailable":null,"minAvailable":null}` | Pod disruption budget settings. |
315315
| podDisruptionBudget.annotations | object | `{}` | Annotations to add to the pod disruption budget. |
316316
| podDisruptionBudget.enabled | bool | `false` | Specifies whether a pod disruption budget should be created. |
317-
| podDisruptionBudget.maxUnavailable | string | `nil` | The maximum number of pods that can be unavailable during disruptions. Can be an absolute number (ex: 5) or a percentage of desired pods (ex: 50%). Cannot be used if minAvailable is set. |
318-
| podDisruptionBudget.minAvailable | string | `nil` | The minimum number of pods that should remain available during disruptions. Can be an absolute number (ex: 5) or a percentage of desired pods (ex: 50%). Cannot be used if maxUnavailable is set. |
317+
| podDisruptionBudget.maxUnavailable | string | `nil` | The maximum number of pods that can be unavailable during disruptions. Can be an absolute number (ex: 5) or a percentage of desired pods (ex: 50%). IMPORTANT: Cannot be used simultaneously with minAvailable. If both are set, minAvailable takes precedence. |
318+
| podDisruptionBudget.minAvailable | string | `nil` | The minimum number of pods that should remain available during disruptions. Can be an absolute number (ex: 5) or a percentage of desired pods (ex: 50%). IMPORTANT: Cannot be used simultaneously with maxUnavailable. If both are set, minAvailable takes precedence. |
319319
| podLabels | object | `{}` | Additional Labels to apply to polaris pods. |
320320
| podSecurityContext | object | `{"fsGroup":10001,"seccompProfile":{"type":"RuntimeDefault"}}` | Security context for the polaris pod. See https://kubernetes.io/docs/tasks/configure-pod-container/security-context/. |
321321
| podSecurityContext.fsGroup | int | `10001` | GID 10001 is compatible with Polaris OSS default images; change this if you are using a different image. |

helm/polaris/templates/poddisruptionbudget.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ metadata:
3232
spec:
3333
{{- if .Values.podDisruptionBudget.minAvailable }}
3434
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
35-
{{- end }}
36-
{{- if .Values.podDisruptionBudget.maxUnavailable }}
35+
{{- else if .Values.podDisruptionBudget.maxUnavailable }}
3736
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
3837
{{- end }}
3938
selector:

helm/polaris/tests/poddisruptionbudget_test.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ tests:
200200
app.kubernetes.io/instance: polaris-release
201201

202202
# validation tests
203-
- it: should handle both minAvailable and maxUnavailable set (minAvailable takes precedence)
203+
- it: should not allow both minAvailable and maxUnavailable (minAvailable takes precedence)
204204
set:
205205
podDisruptionBudget.enabled: true
206206
podDisruptionBudget.minAvailable: 1
@@ -209,6 +209,5 @@ tests:
209209
- equal:
210210
path: spec.minAvailable
211211
value: 1
212-
- equal:
212+
- isNull:
213213
path: spec.maxUnavailable
214-
value: 1

helm/polaris/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ podDisruptionBudget:
6868
enabled: false
6969
# -- The minimum number of pods that should remain available during disruptions.
7070
# Can be an absolute number (ex: 5) or a percentage of desired pods (ex: 50%).
71-
# Cannot be used if maxUnavailable is set.
71+
# IMPORTANT: Cannot be used simultaneously with maxUnavailable. If both are set, minAvailable takes precedence.
7272
minAvailable: ~
7373
# -- The maximum number of pods that can be unavailable during disruptions.
7474
# Can be an absolute number (ex: 5) or a percentage of desired pods (ex: 50%).
75-
# Cannot be used if minAvailable is set.
75+
# IMPORTANT: Cannot be used simultaneously with minAvailable. If both are set, minAvailable takes precedence.
7676
maxUnavailable: ~
7777
# -- Annotations to add to the pod disruption budget.
7878
annotations: {}

0 commit comments

Comments
 (0)