From e462a1420fe061b4b8beba760237f13552cc8fe3 Mon Sep 17 00:00:00 2001 From: Joffrey JANIEC <16088893+jjaniec@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:07:08 +0200 Subject: [PATCH 1/2] Add .Values.revisionHistoryLimit --- src/helm/blue-agent/templates/deployment.yaml | 1 + src/helm/blue-agent/values.yaml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/helm/blue-agent/templates/deployment.yaml b/src/helm/blue-agent/templates/deployment.yaml index f54ef2ac..19458705 100644 --- a/src/helm/blue-agent/templates/deployment.yaml +++ b/src/helm/blue-agent/templates/deployment.yaml @@ -10,6 +10,7 @@ spec: matchLabels: {{- include "blue-agent.selectorLabels" . | nindent 6 }} replicas: {{ .Values.replicaCount | int | required "A value for .Values.replicaCount is required" }} + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} strategy: type: RollingUpdate rollingUpdate: diff --git a/src/helm/blue-agent/values.yaml b/src/helm/blue-agent/values.yaml index 466a7984..0b46049f 100644 --- a/src/helm/blue-agent/values.yaml +++ b/src/helm/blue-agent/values.yaml @@ -126,6 +126,9 @@ tolerations: [] # Pod affinity configuration affinity: {} +# Number of revisions to keep in the history of the Deployment +revisionHistoryLimit: 10 + # Annotations for scheduling and security behaviors # # Example, to be used with img or BuildKit: From 364ded0e701f25540fadc1265e13c99adb609358 Mon Sep 17 00:00:00 2001 From: Joffrey JANIEC <16088893+jjaniec@users.noreply.github.com> Date: Mon, 16 Sep 2024 15:20:02 +0200 Subject: [PATCH 2/2] Make .Values.revisionHistoryLimit required and add warning in values.yaml --- src/helm/blue-agent/templates/deployment.yaml | 2 +- src/helm/blue-agent/values.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/helm/blue-agent/templates/deployment.yaml b/src/helm/blue-agent/templates/deployment.yaml index 19458705..c86018da 100644 --- a/src/helm/blue-agent/templates/deployment.yaml +++ b/src/helm/blue-agent/templates/deployment.yaml @@ -10,7 +10,7 @@ spec: matchLabels: {{- include "blue-agent.selectorLabels" . | nindent 6 }} replicas: {{ .Values.replicaCount | int | required "A value for .Values.replicaCount is required" }} - revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} + revisionHistoryLimit: {{ .Values.revisionHistoryLimit | int | required "A value for .Values.revisionHistoryLimit is required" }} strategy: type: RollingUpdate rollingUpdate: diff --git a/src/helm/blue-agent/values.yaml b/src/helm/blue-agent/values.yaml index 0b46049f..ef2647c7 100644 --- a/src/helm/blue-agent/values.yaml +++ b/src/helm/blue-agent/values.yaml @@ -127,6 +127,7 @@ tolerations: [] affinity: {} # Number of revisions to keep in the history of the Deployment +# Warning: setting this to 0 will disable the Deployment history and cause inability to rollback (see: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#clean-up-policy) revisionHistoryLimit: 10 # Annotations for scheduling and security behaviors