From 8e5ab7c0682151c6939aab6d6a11869a94c65d5d Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Fri, 16 Feb 2024 10:32:01 +0000 Subject: [PATCH] feat(deployments): make spec.revisionHistoryLimit configurable (#121) --- templates/deployment-sidekiq.yaml | 4 +++- templates/deployment-streaming.yaml | 4 +++- templates/deployment-web.yaml | 4 +++- values.yaml | 5 +++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/templates/deployment-sidekiq.yaml b/templates/deployment-sidekiq.yaml index cb98dc2..b906149 100644 --- a/templates/deployment-sidekiq.yaml +++ b/templates/deployment-sidekiq.yaml @@ -22,7 +22,9 @@ spec: type: Recreate {{- end }} replicas: {{ .replicas }} - revisionHistoryLimit: 2 + {{- if (ne (toString $context.Values.mastodon.revisionHistoryLimit) "") }} + revisionHistoryLimit: {{ $context.Values.mastodon.revisionHistoryLimit }} + {{- end }} selector: matchLabels: {{- include "mastodon.selectorLabels" $context | nindent 6 }} diff --git a/templates/deployment-streaming.yaml b/templates/deployment-streaming.yaml index b3c26bd..e64d38f 100644 --- a/templates/deployment-streaming.yaml +++ b/templates/deployment-streaming.yaml @@ -10,7 +10,9 @@ metadata: {{- end }} spec: replicas: {{ .Values.mastodon.streaming.replicas }} - revisionHistoryLimit: 2 + {{- if (ne (toString .Values.mastodon.revisionHistoryLimit) "") }} + revisionHistoryLimit: {{ .Values.mastodon.revisionHistoryLimit }} + {{- end }} selector: matchLabels: {{- include "mastodon.selectorLabels" . | nindent 6 }} diff --git a/templates/deployment-web.yaml b/templates/deployment-web.yaml index 28490a7..b1bb0b8 100644 --- a/templates/deployment-web.yaml +++ b/templates/deployment-web.yaml @@ -10,7 +10,9 @@ metadata: {{- end }} spec: replicas: {{ .Values.mastodon.web.replicas }} - revisionHistoryLimit: 2 + {{- if (ne (toString .Values.mastodon.revisionHistoryLimit) "") }} + revisionHistoryLimit: {{ .Values.mastodon.revisionHistoryLimit }} + {{- end }} selector: matchLabels: {{- include "mastodon.selectorLabels" . | nindent 6 }} diff --git a/values.yaml b/values.yaml index 8378928..617e3cd 100644 --- a/values.yaml +++ b/values.yaml @@ -101,6 +101,11 @@ mastodon: # with keys SECRET_KEY_BASE and OTP_SECRET and # VAPID_PRIVATE_KEY and VAPID_PUBLIC_KEY existingSecret: "" + + # -- The number of old revisions to keep for each Deployment in Kubernetes. + # See https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#clean-up-policy + revisionHistoryLimit: 2 + sidekiq: # -- Pod security context for all Sidekiq Pods, overwrites .Values.podSecurityContext podSecurityContext: {}