Skip to content

Commit 17189bc

Browse files
committed
Added scheduling.minAvailable
1 parent 95eb953 commit 17189bc

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

charts/generic-service/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ app:
6969
| `rollout.flagger` | `false` | Use Flagger to control rollouts (`rollout.controller` must be `Deployment` or `StatefulSet`) |
7070
| `rollout.analysis` | req. for Canary or Flagger | Flagger or Argo Rollouts analysis for automatic `Canary` or `BlueGreen` promotion |
7171
| `rollout.revisionHistoryLimit` | `null` | Number of old ReplicaSets to retain (`rollout.controller` must be `Deployment` or `ArgoRollout`) |
72-
| `replicas` | `1` | The number of instances of the service to run (set at least `2` for Pod Disruption Budget) |
72+
| `replicas` | `1` | The number of instances of the service to run |
7373
| `autoscaling.enabled` | `false` | Enables automatic starting of additional instances |
7474
| `autoscaling.maxReplicas` | `3` | The maximum number of instances to run (must be larger than `replicas`) |
7575
| `autoscaling.metric.type` | `Resource` | The type of metric to use for scaling (`Resource`, `Pods`, `Object` or `External`) |
@@ -86,6 +86,7 @@ app:
8686
| `scheduling.podAffinity` | `{}` | Labels to select other pods this service should share nodes with if possible |
8787
| `scheduling.podAntiAffinity` | `{}` | Labels to select other pods this service must not share nodes with |
8888
| `scheduling.replicaSpread` | `BestEffort` | How to spread replicas across nodes (`BestEffort`, `Strict`, `None`) |
89+
| `scheduling.minAvailable`  | `1` | Minimum number of instances to keep running during cluster maintenance (only if smaller than `replicas`) |
8990
| `persistence.enabled` | `false` | Enables persistent storage for the service |
9091
| `persistence.storageClass` | | The type of disk to use for storage instead of the cluster default |
9192
| `persistence.accessModes` | `[ReadWriteOnce]` | The support access modes the volume can be mounted with |

charts/generic-service/templates/pdb.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and .Values.ingress.enabled (gt .Values.replicas 1.0) }}
1+
{{- if and (gt .Values.scheduling.minAvailable 1.0) (lt .Values.scheduling.minAvailable .Values.replicas) }}
22

33
apiVersion: policy/v1
44
kind: PodDisruptionBudget
@@ -7,7 +7,7 @@ metadata:
77
labels: {{- include "generic-service.top-level-labels" . | nindent 4 }}
88

99
spec:
10-
minAvailable: 1
10+
minAvailable: {{ .Values.scheduling.minAvailable }}
1111

1212
selector:
1313
matchLabels: {{- include "generic-service.selector-labels" . | nindent 6 }}

charts/generic-service/values.schema.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@
443443
"replicas": {
444444
"type": "integer",
445445
"default": 1,
446-
"description": "The number of instances of the service to run (set at least 2 for Pod Disruption Budget)"
446+
"description": "The number of instances of the service to run"
447447
},
448448
"autoscaling": {
449449
"type": "object",
@@ -585,6 +585,11 @@
585585
],
586586
"default": "BestEffort",
587587
"description": "How to spread replicas across nodes"
588+
},
589+
"minAvailable": {
590+
"type": "integer",
591+
"default": 1,
592+
"description": "Minimum number of instances to keep running during cluster maintenance (only applied if this value is smaller than replicas)"
588593
}
589594
},
590595
"additionalProperties": false

charts/generic-service/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ scheduling:
9090
podAffinity: {}
9191
podAntiAffinity: {}
9292
replicaSpread: BestEffort
93+
minAvailable: 1
9394

9495
persistence:
9596
enabled: false

0 commit comments

Comments
 (0)