Skip to content

Commit 4b31aaf

Browse files
committed
fix: use Recreate strategy for dev/test with ReadWriteOnce PVC
1 parent a3ba46e commit 4b31aaf

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

helm/eagle-api/templates/deployment.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@ spec:
1212
{{- if not .Values.autoscaling.enabled }}
1313
replicas: {{ .Values.replicaCount }}
1414
{{- end }}
15+
{{- if .Values.updateStrategy }}
16+
strategy:
17+
{{- toYaml .Values.updateStrategy | nindent 4 }}
18+
{{- else }}
1519
strategy:
1620
type: RollingUpdate
1721
rollingUpdate:
1822
maxUnavailable: 0 # Never terminate pods until new ones are ready
1923
maxSurge: 1 # Create one new pod at a time
24+
{{- end }}
2025
selector:
2126
matchLabels:
2227
{{- include "eagle-api.selectorLabels" . | nindent 6 }}

helm/eagle-api/values-dev.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ replicaCount: 1
55
image:
66
tag: dev
77

8+
# Use Recreate strategy for single replica with ReadWriteOnce PVC
9+
# (Rolling update doesn't work with RWO volumes)
10+
updateStrategy:
11+
type: Recreate
12+
813
route:
914
host: eagle-dev.apps.silver.devops.gov.bc.ca
1015

helm/eagle-api/values-test.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ replicaCount: 1
55
image:
66
tag: test
77

8+
# Use Recreate strategy for single replica with ReadWriteOnce PVC
9+
# (Rolling update doesn't work with RWO volumes)
10+
updateStrategy:
11+
type: Recreate
12+
813
route:
914
host: eagle-test.apps.silver.devops.gov.bc.ca
1015

0 commit comments

Comments
 (0)