Skip to content

Commit

Permalink
Added support for relative values in scheduling.minAvailable
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianeicher committed Sep 20, 2024
1 parent 9c99703 commit dd7105d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions charts/generic-service/ci/relative-min-available-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Relative minimum availability test

image:
repository: jwilder/whoami
tag: latest

replicas: 3

scheduling:
minAvailable: 50%
2 changes: 1 addition & 1 deletion charts/generic-service/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and (gt .Values.scheduling.minAvailable 0.0) (lt .Values.scheduling.minAvailable .Values.replicas) }}
{{- if or (kindIs "string" .Values.scheduling.minAvailable) (and (gt .Values.scheduling.minAvailable 0.0) (lt .Values.scheduling.minAvailable .Values.replicas)) }}

apiVersion: policy/v1
kind: PodDisruptionBudget
Expand Down
2 changes: 1 addition & 1 deletion charts/generic-service/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@
"description": "How to spread replicas across nodes"
},
"minAvailable": {
"type": "integer",
"type": ["integer", "string"],
"default": 1,
"description": "Minimum number of instances to keep running during cluster maintenance (only applied if this value is smaller than replicas)"
}
Expand Down

0 comments on commit dd7105d

Please sign in to comment.