Allow configure StatefulSet updateStrategy (#172)

This commit is contained in:
Yong Wen Chua 2020-01-18 20:36:45 +08:00 committed by Jason O'Donnell
parent 0099ea8a94
commit eccd71bfe2
3 changed files with 24 additions and 9 deletions

View file

@ -15,7 +15,7 @@ spec:
podManagementPolicy: Parallel
replicas: {{ template "vault.replicas" . }}
updateStrategy:
type: OnDelete
type: {{ .Values.server.updateStrategyType }}
selector:
matchLabels:
app.kubernetes.io/name: {{ template "vault.name" . }}

View file

@ -97,6 +97,17 @@ load _helpers
[ "${actual}" = "OnDelete" ]
}
@test "server/ha-StatefulSet: RollingUpdate updateStrategy" {
cd `chart_dir`
local actual=$(helm template \
-x templates/server-statefulset.yaml \
--set 'server.ha.enabled=true' \
--set 'server.updateStrategyType="RollingUpdate"' \
. | tee /dev/stderr |
yq -r '.spec.updateStrategy.type' | tee /dev/stderr)
[ "${actual}" = "RollingUpdate" ]
}
#--------------------------------------------------------------------
# affinity

View file

@ -76,6 +76,10 @@ server:
# Overrides the default Image Pull Policy
pullPolicy: IfNotPresent
# Configure the Update Strategy Type for the StatefulSet
# See https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies
updateStrategyType: "OnDelete"
resources:
# resources:
# requests: