Skip to content

Commit

Permalink
Allow web deployment value to be configured through values (#788)
Browse files Browse the repository at this point in the history
* Allow web deployment value to be configured through values

This will let us switch to e.g. Argo Rollouts

* Bump version

* fix syntax
  • Loading branch information
frankh authored Jan 24, 2024
1 parent 0f74937 commit 207a918
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/posthog/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type: application

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

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
Expand Down
16 changes: 14 additions & 2 deletions charts/posthog/templates/web-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.web.enabled -}}
apiVersion: apps/v1
kind: Deployment
apiVersion: {{ .Values.web.deployment.apiVersion }}
kind: {{ .Values.web.deployment.kind }}
metadata:
name: {{ template "posthog.fullname" . }}-web
labels: {{- include "_snippet-metadata-labels-common" . | nindent 4 }}
Expand All @@ -16,10 +16,22 @@ spec:
{{- end }}

strategy:
{{- if eq .Values.web.deployment.strategy "rollingUpdate" }}
type: RollingUpdate
rollingUpdate:
maxSurge: {{ .Values.web.rollout.maxSurge }}
maxUnavailable: {{ .Values.web.rollout.maxUnavailable }}
{{- else if eq .Values.web.deployment.strategy "canary" }}
canary:
steps:
- setWeight: 1
- pause: {duration: 60s}
- setWeight: 10
- pause: {duration: 60s}
- setWeight: 50
- pause: {duration: 60s}
- setWeight: 100
{{- end }}

template:
metadata:
Expand Down
5 changes: 5 additions & 0 deletions charts/posthog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ web:

image: {}

deployment:
apiVersion: apps/v1
kind: Deployment
strategy: rollingUpdate

podAnnotations:
# Uncomment these lines if you want Prometheus server to scrape metrics.
# prometheus.io/scrape: "true"
Expand Down

0 comments on commit 207a918

Please sign in to comment.