Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby

Make rolling update strategies configurable for web and worker deployments in Helm templates (#522)

LPWf48e020fc22a
diff --git a/charts/sure/templates/web-deployment.yaml b/charts/sure/templates/web-deployment.yaml
index 3c2cb2654a..326b7e6c50 100644
--- a/charts/sure/templates/web-deployment.yaml
+++ b/charts/sure/templates/web-deployment.yaml
@@ -10,8 +10,13 @@ spec:
strategy:
type: RollingUpdate
rollingUpdate:
- maxUnavailable: 0
- maxSurge: 25%
+ {{- if and .Values.web.strategy .Values.web.strategy.rollingUpdate }}
+ maxUnavailable: {{ .Values.web.strategy.rollingUpdate.maxUnavailable | default 1 }}
+ maxSurge: {{ .Values.web.strategy.rollingUpdate.maxSurge | default 0 }}
+ {{- else }}
+ maxUnavailable: 1
+ maxSurge: 0
+ {{- end }}
selector:
matchLabels:
app.kubernetes.io/component: web
diff --git a/charts/sure/templates/worker-deployment.yaml b/charts/sure/templates/worker-deployment.yaml
index 15c38194e2..a358e28b6c 100644
--- a/charts/sure/templates/worker-deployment.yaml
+++ b/charts/sure/templates/worker-deployment.yaml
@@ -6,7 +6,17 @@ metadata:
{{- include "sure.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.worker.replicas }}
- revisionHistoryLimit: 2
+ revisionHistoryLimit: {{ .Values.worker.revisionHistoryLimit | default 2 }}
+ strategy:
+ type: RollingUpdate
+ rollingUpdate:
+ {{- if and .Values.worker.strategy .Values.worker.strategy.rollingUpdate }}
+ maxUnavailable: {{ .Values.worker.strategy.rollingUpdate.maxUnavailable | default 1 }}
+ maxSurge: {{ .Values.worker.strategy.rollingUpdate.maxSurge | default 0 }}
+ {{- else }}
+ maxUnavailable: 1
+ maxSurge: 0
+ {{- end }}
selector:
matchLabels:
app.kubernetes.io/component: worker