From 194cda4c528116cd88adb77dbdaf1f3705d8bd32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ask=20Bj=C3=B8rn=20Hansen?= Date: Fri, 5 Jun 2020 01:37:00 -0700 Subject: [PATCH] Support specifying deployment strategy --- templates/deployment.yaml | 5 ++++- values.yaml | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 4ff836e..04f5ae3 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -1,4 +1,3 @@ - apiVersion: apps/v1 kind: Deployment metadata: @@ -13,6 +12,10 @@ spec: selector: matchLabels: app: {{ template "fullname" . }} +{{- with .Values.deploymentStrategy }} + strategy: +{{ toYaml . | trim | indent 4 }} +{{- end }} template: metadata: labels: diff --git a/values.yaml b/values.yaml index acf211b..0390d22 100644 --- a/values.yaml +++ b/values.yaml @@ -114,6 +114,18 @@ resources: memory: 64Mi cpu: 50m +## Update strategy - for deployments with RWO PVs attached and with a +## single replicas = 1, an update can get stuck, as the previous pod +## remains attached to the PVC. Changing the strategy to "Recreate" +## will terminate the single previous pod, so that the new, incoming +## pod can attach to the PV +# deploymentStrategy: +# rollingUpdate: +# type: "Recreate" +# type: "RollingUpdate" +# maxSurge: 1 +# maxUnavailable: 1 + ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ ## ref: