Skip to content

Commit

Permalink
Added rollout.revisionHistoryLimit
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Campion authored and bastianeicher committed Apr 16, 2024
1 parent c006a4c commit 03ad242
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/generic-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ app:
| `rollout.autoPromotion` | `true` | Automatically promote rollouts (if `rollout.strategy` is `BlueGreen` and `rollout.flagger` if `false`) |
| `rollout.flagger` | `false` | Use Flagger to control rollouts (`rollout.controller` must be `Deployment` or `StatefulSet`) |
| `rollout.analysis` | req. for Canary or Flagger | Flagger or Argo Rollouts analysis for automatic `Canary` or `BlueGreen` promotion |
| `rollout.revisionHistoryLimit` | `null` | Number of old ReplicaSets to retain (`rollout.controller` must be `Deployment` or `ArgoRollout`) |
| `replicas` | `1` | The number of instances of the service to run (set at least `2` for Pod Disruption Budget) |
| `autoscaling.enabled` | `false` | Enables automatic starting of additional instances |
| `autoscaling.maxReplicas` | `3` | The maximum number of instances to run (must be larger than `replicas`) |
Expand Down
8 changes: 8 additions & 0 deletions charts/generic-service/ci/revision-history-limit-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# revisionHistoryLimit test

image:
repository: jwilder/whoami
tag: latest

rollout:
revisionHistoryLimit: 3
7 changes: 7 additions & 0 deletions charts/generic-service/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ spec:
replicas: {{ .Values.replicas | int }}
{{- end }}

{{- if (ne .Values.rollout.revisionHistoryLimit nil) }}
{{- if (and (ne .Values.rollout.controller "Deployment") (ne .Values.rollout.controller "ArgoRollout")) }}
{{ fail "rollout.revisionHistoryLimit cannot be non-null if rollout.controller is not Deployment or ArgoRollout" }}
{{- end }}
revisionHistoryLimit: {{ .Values.rollout.revisionHistoryLimit | int }}
{{- end }}

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

Expand Down
4 changes: 4 additions & 0 deletions charts/generic-service/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,10 @@
},
"analysis": {
"description": "Flagger or Argo Rollouts analysis for automatic Canary or BlueGreen promotion"
},
"revisionHistoryLimit": {
"type": ["integer", "null"],
"description": "Number of old ReplicaSets to retain (rollout.controller must be Deployment or ArgoRollout)"
}
},
"additionalProperties": false
Expand Down
1 change: 1 addition & 0 deletions charts/generic-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ rollout:
autoPromotion: true
flagger: false
analysis: null
revisionHistoryLimit: null

replicas: 1

Expand Down

0 comments on commit 03ad242

Please sign in to comment.