Skip to content

Commit

Permalink
Allow web deployment value to be configured through values
Browse files Browse the repository at this point in the history
This will let us switch to e.g. Argo Rollouts
  • Loading branch information
frankh committed Jan 24, 2024
1 parent 0f74937 commit fa3b57f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
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 .Values.web.deployment.strategy == "rollingUpdate" }}
type: RollingUpdate
rollingUpdate:
maxSurge: {{ .Values.web.rollout.maxSurge }}
maxUnavailable: {{ .Values.web.rollout.maxUnavailable }}
{{- else if .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 fa3b57f

Please sign in to comment.