From a14276d528a53c108f668acaae3a998d6c659ab6 Mon Sep 17 00:00:00 2001 From: Alex Shearn Date: Tue, 7 May 2024 14:18:12 +0100 Subject: [PATCH] Expose the deployment strategy values for the policy controller Prior to this change, the policy controller webhook was not able to have its deployment strategy modified. If you only deployed a single replica, it could not perform a rolling update due to the default `maxSurge: 25%` being rounded down to 0. This change exposes those values, so that the `maxSurge` can be updated and a single instance can be rolled. Fixes #748. --- .../templates/webhook/deployment_webhook.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/charts/policy-controller/templates/webhook/deployment_webhook.yaml b/charts/policy-controller/templates/webhook/deployment_webhook.yaml index 54fd36d6..c736e876 100644 --- a/charts/policy-controller/templates/webhook/deployment_webhook.yaml +++ b/charts/policy-controller/templates/webhook/deployment_webhook.yaml @@ -12,6 +12,13 @@ spec: matchLabels: {{- include "policy-controller.selectorLabels" . | nindent 6 }} control-plane: {{ template "policy-controller.fullname" . }}-webhook + +{{- if .Values.deployment.strategy }} + strategy: +{{ toYaml .Values.deployment.strategy | trim | indent 4 }} + {{ if eq .Values.deployment.strategy.type "Recreate" }}rollingUpdate: null{{ end }} +{{- end }} + template: metadata: labels: