Skip to content

Commit 0a5ee7f

Browse files
meili-bors[bot]Tchoupinaxbrunoocasali
authored
Merge #238
238: feat: handle correctly when replica count is set to 0 r=brunoocasali a=Tchoupinax Hello, This evolution brings the ability to set the replica count to zero. There is an unexpected behaviour in helm that does not allow it as we would expect it. My current usage of putting replica count to zero is for https://github.com/acouvreur/sablier Thank for your work! Co-authored-by: Tchoupinax <corentinfiloche@hotmail.fr> Co-authored-by: brunoocasali <brunoocasali@users.noreply.github.com> Co-authored-by: Bruno Casali <brunoocasali@gmail.com>
2 parents e2d6b4e + 355ace6 commit 0a5ee7f

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

charts/meilisearch/Chart.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ apiVersion: v1
22
appVersion: "v1.10.0"
33
description: A Helm chart for the Meilisearch search engine
44
name: meilisearch
5-
version: 0.10.1
5+
version: 0.10.2
66
icon: https://raw.githubusercontent.com/meilisearch/integration-guides/main/assets/logos/logo.svg
77
home: https://github.com/meilisearch/meilisearch-kubernetes/tree/main/charts/meilisearch
88
maintainers:
9-
- name: Bruno
10-
email: bruno@meilisearch.com
11-
- name: Clementine
12-
email: clementine@meilisearch.com
9+
- name: Bruno
10+
email: bruno@meilisearch.com
11+
- name: Clementine
12+
email: clementine@meilisearch.com

charts/meilisearch/templates/statefulset.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ metadata:
55
labels:
66
{{- include "meilisearch.labels" . | nindent 4 }}
77
spec:
8+
# Value 0 is bad interpreted it goes to 1 by default
9+
# https://github.com/helm/helm/issues/3164
10+
{{- if (eq 0 (int .Values.replicaCount))}}
11+
replicas: 0
12+
{{- else }}
813
replicas: {{ .Values.replicaCount | default 1 }}
14+
{{- end }}
915
serviceName: {{ template "meilisearch.fullname" . }}
1016
selector:
1117
matchLabels:

manifests/meilisearch.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ metadata:
6060
app.kubernetes.io/component: search-engine
6161
app.kubernetes.io/part-of: meilisearch
6262
spec:
63-
replicas: 1
63+
# Value 0 is bad interpreted it goes to 1 by default
64+
# https://github.com/helm/helm/issues/3164
65+
replicas: 0
6466
serviceName: meilisearch
6567
selector:
6668
matchLabels:
@@ -75,7 +77,7 @@ spec:
7577
app.kubernetes.io/component: search-engine
7678
app.kubernetes.io/part-of: meilisearch
7779
annotations:
78-
checksum/config: 57066f343c11bb744192756429e406248806cda981bd4a71c7c02dcafc103072
80+
checksum/config: 3b17fd234a29aacf2e98ffa09aca207fa5519140923bc64b656070f54412fe1f
7981
spec:
8082
serviceAccountName: meilisearch
8183
securityContext:

0 commit comments

Comments
 (0)