Allow scale to zero (#943)
This commit is contained in:
parent
9a16496e86
commit
ec964a33ea
2 changed files with 27 additions and 1 deletions
|
@ -156,7 +156,11 @@ Set's the replica count based on the different modes configured by user
|
||||||
{{ if eq .mode "standalone" }}
|
{{ if eq .mode "standalone" }}
|
||||||
{{- default 1 -}}
|
{{- default 1 -}}
|
||||||
{{ else if eq .mode "ha" }}
|
{{ else if eq .mode "ha" }}
|
||||||
{{- .Values.server.ha.replicas | default 3 -}}
|
{{- if kindIs "int64" .Values.server.ha.replicas -}}
|
||||||
|
{{- .Values.server.ha.replicas -}}
|
||||||
|
{{ else }}
|
||||||
|
{{- 3 -}}
|
||||||
|
{{- end -}}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{- default 1 -}}
|
{{- default 1 -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -157,6 +157,28 @@ load _helpers
|
||||||
[ "${actual}" = "10" ]
|
[ "${actual}" = "10" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "server/ha-StatefulSet: zero replicas" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
--show-only templates/server-statefulset.yaml \
|
||||||
|
--set 'server.ha.enabled=true' \
|
||||||
|
--set 'server.ha.replicas=0' \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq -r '.spec.replicas' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "0" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "server/ha-StatefulSet: invalid value for replicas" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
--show-only templates/server-statefulset.yaml \
|
||||||
|
--set 'server.ha.enabled=true' \
|
||||||
|
--set 'server.ha.replicas=null' \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq -r '.spec.replicas' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "3" ]
|
||||||
|
}
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# resources
|
# resources
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue