Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle correctly when replica count is set to 0 #238

Closed
wants to merge 14 commits into from
10 changes: 5 additions & 5 deletions charts/meilisearch/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ apiVersion: v1
appVersion: "v1.10.0"
description: A Helm chart for the Meilisearch search engine
name: meilisearch
version: 0.10.1
version: 0.10.2
icon: https://raw.githubusercontent.com/meilisearch/integration-guides/main/assets/logos/logo.svg
home: https://github.com/meilisearch/meilisearch-kubernetes/tree/main/charts/meilisearch
maintainers:
- name: Bruno
email: [email protected]
- name: Clementine
email: [email protected]
- name: Bruno
email: [email protected]
- name: Clementine
email: [email protected]
6 changes: 6 additions & 0 deletions charts/meilisearch/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ metadata:
labels:
{{- include "meilisearch.labels" . | nindent 4 }}
spec:
# Value 0 is bad interpreted it goes to 1 by default
# https://github.com/helm/helm/issues/3164
{{- if (eq 0 (int .Values.replicaCount))}}
replicas: 0
{{- else }}
replicas: {{ .Values.replicaCount | default 1 }}
{{- end }}
serviceName: {{ template "meilisearch.fullname" . }}
selector:
matchLabels:
Expand Down
6 changes: 4 additions & 2 deletions manifests/meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ metadata:
app.kubernetes.io/component: search-engine
app.kubernetes.io/part-of: meilisearch
spec:
replicas: 1
# Value 0 is bad interpreted it goes to 1 by default
# https://github.com/helm/helm/issues/3164
replicas: 0
Tchoupinax marked this conversation as resolved.
Show resolved Hide resolved
brunoocasali marked this conversation as resolved.
Show resolved Hide resolved
serviceName: meilisearch
selector:
matchLabels:
Expand All @@ -75,7 +77,7 @@ spec:
app.kubernetes.io/component: search-engine
app.kubernetes.io/part-of: meilisearch
annotations:
checksum/config: 57066f343c11bb744192756429e406248806cda981bd4a71c7c02dcafc103072
checksum/config: 3b17fd234a29aacf2e98ffa09aca207fa5519140923bc64b656070f54412fe1f
spec:
serviceAccountName: meilisearch
securityContext:
Expand Down