From 5f286cb84fec1906e8a47f0d66518b18596d47b4 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Thu, 12 Jan 2023 16:10:10 +0000 Subject: [PATCH 1/3] Allow specifying rollout strategy I'd like to test some changes on cloud, and we need to make this configurable for that to happen. --- .../templates/_snippet-plugins-deployment.tpl | 7 ++++ .../posthog/templates/events-deployment.yaml | 7 ++++ charts/posthog/values.yaml | 42 +++++++++++++++++++ 3 files changed, 56 insertions(+) diff --git a/charts/posthog/templates/_snippet-plugins-deployment.tpl b/charts/posthog/templates/_snippet-plugins-deployment.tpl index fae36fcbe..0ff3cbdef 100644 --- a/charts/posthog/templates/_snippet-plugins-deployment.tpl +++ b/charts/posthog/templates/_snippet-plugins-deployment.tpl @@ -18,6 +18,13 @@ spec: {{- if not .params.hpa.enabled }} replicas: {{ .params.replicacount }} {{- end }} + + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: {{ .params.rollout.maxSurge }} + maxUnavailable: {{ .params.rollout.maxUnavailable }} + template: metadata: annotations: diff --git a/charts/posthog/templates/events-deployment.yaml b/charts/posthog/templates/events-deployment.yaml index ca1213466..dd40f9815 100644 --- a/charts/posthog/templates/events-deployment.yaml +++ b/charts/posthog/templates/events-deployment.yaml @@ -14,6 +14,13 @@ spec: {{- if not .Values.events.hpa.enabled }} replicas: {{ .Values.events.replicacount }} {{- end }} + + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: {{ .Values.events.rollout.maxSurge }} + maxUnavailable: {{ .Values.events.rollout.maxUnavailable }} + template: metadata: annotations: diff --git a/charts/posthog/values.yaml b/charts/posthog/values.yaml index 262af8287..7ef73ce0a 100644 --- a/charts/posthog/values.yaml +++ b/charts/posthog/values.yaml @@ -74,6 +74,12 @@ events: # for configuration options behavior: + rollout: + # The max surge in pods during a rollout + maxSurge: 25% + # The max unavailable during a rollout + maxUnavailable: 25% + # -- Additional env variables to inject into the events stack, uses `web.env` if empty. env: [] @@ -250,6 +256,12 @@ plugins: # for configuration options behavior: + rollout: + # The max surge in pods during a rollout + maxSurge: 25% + # The max unavailable during a rollout + maxUnavailable: 25% + # -- Additional env variables to inject into the plugin-server stack deployment. env: [] @@ -322,6 +334,12 @@ pluginsAsync: # for configuration options behavior: + rollout: + # The max surge in pods during a rollout + maxSurge: 25% + # The max unavailable during a rollout + maxUnavailable: 25% + # -- Additional env variables to inject into the plugin-server stack deployment. env: [] @@ -399,6 +417,12 @@ pluginsIngestion: # for configuration options behavior: + rollout: + # The max surge in pods during a rollout + maxSurge: 25% + # The max unavailable during a rollout + maxUnavailable: 25% + # -- Additional env variables to inject into the plugin-server stack deployment. env: [] @@ -470,6 +494,12 @@ pluginsExports: # for configuration options behavior: + rollout: + # The max surge in pods during a rollout + maxSurge: 25% + # The max unavailable during a rollout + maxUnavailable: 25% + # -- Additional env variables to inject into the plugin-server stack deployment. env: [] @@ -541,6 +571,12 @@ pluginsJobs: # for configuration options behavior: + rollout: + # The max surge in pods during a rollout + maxSurge: 25% + # The max unavailable during a rollout + maxUnavailable: 25% + # -- Additional env variables to inject into the plugin-server stack deployment. env: [] @@ -611,6 +647,12 @@ pluginsScheduler: # for configuration options behavior: + rollout: + # The max surge in pods during a rollout + maxSurge: 25% + # The max unavailable during a rollout + maxUnavailable: 25% + # -- Additional env variables to inject into the plugin-server stack deployment. env: [] From e014093b8ce168769dad866c2df3857713fbb3d5 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Thu, 12 Jan 2023 16:14:39 +0000 Subject: [PATCH 2/3] Bump chart version --- charts/posthog/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/posthog/Chart.yaml b/charts/posthog/Chart.yaml index a27d078fe..9a5dd8ca3 100644 --- a/charts/posthog/Chart.yaml +++ b/charts/posthog/Chart.yaml @@ -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.2.7 +version: 30.2.8 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. From db95148561a587254750ce12b90ccebcc2e38517 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Thu, 12 Jan 2023 16:21:43 +0000 Subject: [PATCH 3/3] Allow configuring web, worker --- charts/posthog/templates/web-deployment.yaml | 7 +++++++ charts/posthog/templates/worker-deployment.yaml | 7 +++++++ charts/posthog/values.yaml | 12 ++++++++++++ 3 files changed, 26 insertions(+) diff --git a/charts/posthog/templates/web-deployment.yaml b/charts/posthog/templates/web-deployment.yaml index a47ab3c4f..335417222 100644 --- a/charts/posthog/templates/web-deployment.yaml +++ b/charts/posthog/templates/web-deployment.yaml @@ -14,6 +14,13 @@ spec: {{- if not .Values.web.hpa.enabled }} replicas: {{ .Values.web.replicacount }} {{- end }} + + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: {{ .Values.web.rollout.maxSurge }} + maxUnavailable: {{ .Values.web.rollout.maxUnavailable }} + template: metadata: annotations: diff --git a/charts/posthog/templates/worker-deployment.yaml b/charts/posthog/templates/worker-deployment.yaml index ca48368d3..b9d07c008 100644 --- a/charts/posthog/templates/worker-deployment.yaml +++ b/charts/posthog/templates/worker-deployment.yaml @@ -14,6 +14,13 @@ spec: {{- if not .Values.worker.hpa.enabled }} replicas: {{ .Values.worker.replicacount }} {{- end }} + + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: {{ .Values.worker.rollout.maxSurge }} + maxUnavailable: {{ .Values.worker.rollout.maxUnavailable }} + template: metadata: annotations: diff --git a/charts/posthog/values.yaml b/charts/posthog/values.yaml index 7ef73ce0a..5b946a212 100644 --- a/charts/posthog/values.yaml +++ b/charts/posthog/values.yaml @@ -117,6 +117,12 @@ web: # for configuration options behavior: + rollout: + # The max surge in pods during a rollout + maxSurge: 25% + # The max unavailable during a rollout + maxUnavailable: 25% + # -- Resource limits for web service. resources: {} @@ -210,6 +216,12 @@ worker: # for configuration options behavior: + rollout: + # The max surge in pods during a rollout + maxSurge: 25% + # The max unavailable during a rollout + maxUnavailable: 25% + # -- Additional env variables to inject into the worker stack deployment. env: []