Skip to content

Commit

Permalink
Merge #238
Browse files Browse the repository at this point in the history
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 <[email protected]>
Co-authored-by: brunoocasali <[email protected]>
Co-authored-by: Bruno Casali <[email protected]>
  • Loading branch information
4 people authored Oct 2, 2024
2 parents e2d6b4e + e9856ae commit ae56d0a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
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
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

0 comments on commit ae56d0a

Please sign in to comment.