Skip to content

Commit 207a918

Browse files
authored
Allow web deployment value to be configured through values (#788)
* Allow web deployment value to be configured through values This will let us switch to e.g. Argo Rollouts * Bump version * fix syntax
1 parent 0f74937 commit 207a918

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

charts/posthog/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type: application
1111

1212
# This is the chart version. This version number should be incremented each time you make changes
1313
# to the chart and its templates, including the app version.
14-
version: 30.41.0
14+
version: 30.42.0
1515

1616
# This is the version number of the application being deployed. This version number should be
1717
# incremented each time you make changes to the application.

charts/posthog/templates/web-deployment.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{- if .Values.web.enabled -}}
2-
apiVersion: apps/v1
3-
kind: Deployment
2+
apiVersion: {{ .Values.web.deployment.apiVersion }}
3+
kind: {{ .Values.web.deployment.kind }}
44
metadata:
55
name: {{ template "posthog.fullname" . }}-web
66
labels: {{- include "_snippet-metadata-labels-common" . | nindent 4 }}
@@ -16,10 +16,22 @@ spec:
1616
{{- end }}
1717

1818
strategy:
19+
{{- if eq .Values.web.deployment.strategy "rollingUpdate" }}
1920
type: RollingUpdate
2021
rollingUpdate:
2122
maxSurge: {{ .Values.web.rollout.maxSurge }}
2223
maxUnavailable: {{ .Values.web.rollout.maxUnavailable }}
24+
{{- else if eq .Values.web.deployment.strategy "canary" }}
25+
canary:
26+
steps:
27+
- setWeight: 1
28+
- pause: {duration: 60s}
29+
- setWeight: 10
30+
- pause: {duration: 60s}
31+
- setWeight: 50
32+
- pause: {duration: 60s}
33+
- setWeight: 100
34+
{{- end }}
2335

2436
template:
2537
metadata:

charts/posthog/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ web:
191191

192192
image: {}
193193

194+
deployment:
195+
apiVersion: apps/v1
196+
kind: Deployment
197+
strategy: rollingUpdate
198+
194199
podAnnotations:
195200
# Uncomment these lines if you want Prometheus server to scrape metrics.
196201
# prometheus.io/scrape: "true"

0 commit comments

Comments
 (0)