From fa3b57f7ed0aaafdd7b17dd9e87bada2f9c454e3 Mon Sep 17 00:00:00 2001 From: Frank Hamand Date: Wed, 24 Jan 2024 12:46:53 +0000 Subject: [PATCH] Allow web deployment value to be configured through values This will let us switch to e.g. Argo Rollouts --- charts/posthog/templates/web-deployment.yaml | 16 ++++++++++++++-- charts/posthog/values.yaml | 5 +++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/charts/posthog/templates/web-deployment.yaml b/charts/posthog/templates/web-deployment.yaml index ecedfc7f..747a9a9d 100644 --- a/charts/posthog/templates/web-deployment.yaml +++ b/charts/posthog/templates/web-deployment.yaml @@ -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 }} @@ -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: diff --git a/charts/posthog/values.yaml b/charts/posthog/values.yaml index 5c60921d..8e226b51 100644 --- a/charts/posthog/values.yaml +++ b/charts/posthog/values.yaml @@ -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"