From 03cca65ce584567a5ddf3a46484151b1e62ccdf0 Mon Sep 17 00:00:00 2001 From: Paul de Nonancourt Date: Wed, 16 Nov 2022 16:06:53 +0100 Subject: [PATCH 1/2] Add possibility to mount additional volumes on StatefulSet --- charts/meilisearch/Chart.yaml | 2 +- charts/meilisearch/README.md | 6 +++++- charts/meilisearch/templates/statefulset.yaml | 14 ++++++++++++-- charts/meilisearch/values.yaml | 4 ++++ 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/charts/meilisearch/Chart.yaml b/charts/meilisearch/Chart.yaml index aaba6e7..8c2c3d8 100644 --- a/charts/meilisearch/Chart.yaml +++ b/charts/meilisearch/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "v0.29.0" description: A Helm chart for the Meilisearch search engine name: meilisearch -version: 0.1.42 +version: 0.1.43 icon: https://res.cloudinary.com/meilisearch/image/upload/v1597822872/Logo/logo_img.svg home: https://github.com/meilisearch/meilisearch-kubernetes/charts maintainers: diff --git a/charts/meilisearch/README.md b/charts/meilisearch/README.md index 7ca1e76..7dd67ed 100644 --- a/charts/meilisearch/README.md +++ b/charts/meilisearch/README.md @@ -61,7 +61,7 @@ helm uninstall | `image.pullPolicy` | Meilisearch image pull policy | `IfNotPresent` | | | | `image.pullSecret` | Secret to authenticate against the docker registry | '' | -| | | +| | | | `serviceAccount.create` | Should this chart create a service account | `true` | | | | `serviceAccount.annotations` | Additional annotations for created service account | `{}` @@ -102,6 +102,10 @@ helm uninstall | | | | `command` | Pod command | `[]` | | | +| `volumes` | Additional volumes for pod | `[]` +| | | +| `volumeMounts` | Additional volumes to mount on pod | `[]` +| | | | `tolerations` | Tolerations for pod assignment | `[]` | | | | `nodeSelector` | Node labels for pod assignment | `{}` diff --git a/charts/meilisearch/templates/statefulset.yaml b/charts/meilisearch/templates/statefulset.yaml index a5903f3..a9add98 100644 --- a/charts/meilisearch/templates/statefulset.yaml +++ b/charts/meilisearch/templates/statefulset.yaml @@ -24,20 +24,30 @@ spec: imagePullSecrets: - name: {{ .Values.image.pullSecret }} {{- end }} - {{- if .Values.persistence.enabled }} + {{- if or .Values.persistence.enabled .Values.volumes }} volumes: + {{- if .Values.persistence.enabled }} - name: {{ .Values.persistence.volume.name }} persistentVolumeClaim: claimName: {{ include "meilisearch.fullname" . }} + {{- end }} + {{- if .Values.volumes }} +{{ toYaml .Values.volumes | indent 8 }} + {{- end }} {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- if .Values.persistence.enabled }} + {{- if or .Values.persistence.enabled .Values.volumeMounts }} volumeMounts: + {{- if .Values.persistence.enabled }} - name: {{ .Values.persistence.volume.name }} mountPath: {{ .Values.persistence.volume.mountPath }} + {{- end }} + {{- if .Values.volumeMounts }} +{{ toYaml .Values.volumeMounts | indent 12 }} + {{- end }} {{- end }} envFrom: - configMapRef: diff --git a/charts/meilisearch/values.yaml b/charts/meilisearch/values.yaml index 934b09d..f36771d 100644 --- a/charts/meilisearch/values.yaml +++ b/charts/meilisearch/values.yaml @@ -97,6 +97,10 @@ resources: {} # cpu: 100m # memory: 128Mi +volumes: [] + +volumeMounts: [] + nodeSelector: {} tolerations: [] From 0d29812968e6d2a3f3a54f4cab4f4ea438391f27 Mon Sep 17 00:00:00 2001 From: Paul de Nonancourt Date: Wed, 16 Nov 2022 16:30:12 +0100 Subject: [PATCH 2/2] Add possibility to specify envFrom variable --- charts/meilisearch/README.md | 2 ++ charts/meilisearch/templates/statefulset.yaml | 3 +++ charts/meilisearch/values.yaml | 2 ++ 3 files changed, 7 insertions(+) diff --git a/charts/meilisearch/README.md b/charts/meilisearch/README.md index 7dd67ed..47f1ec7 100644 --- a/charts/meilisearch/README.md +++ b/charts/meilisearch/README.md @@ -54,6 +54,8 @@ helm uninstall | | | | `auth.existingMasterKeySecret` | Uses an existing secret that has the MEILI_MASTER_KEY set | `nil` | | | +| `envFrom` | Additional environment variables from ConfigMap or secrets | `[]` +| | | | `image.repository` | Meilisearch image name | `getmeili/meilisearch` | | | | `image.tag` | Meilisearch image tag | `{TAG_NAME}` diff --git a/charts/meilisearch/templates/statefulset.yaml b/charts/meilisearch/templates/statefulset.yaml index a9add98..6e4cb8b 100644 --- a/charts/meilisearch/templates/statefulset.yaml +++ b/charts/meilisearch/templates/statefulset.yaml @@ -56,6 +56,9 @@ spec: - secretRef: name: {{ template "secretMasterKeyName" . }} {{- end }} + {{- if .Values.envFrom }} +{{ toYaml .Values.envFrom | indent 10 }} + {{- end }} {{- if ne (len .Values.command) 0 }} command: {{ toYaml .Values.command | indent 12 }} diff --git a/charts/meilisearch/values.yaml b/charts/meilisearch/values.yaml index f36771d..f5a3700 100644 --- a/charts/meilisearch/values.yaml +++ b/charts/meilisearch/values.yaml @@ -34,6 +34,8 @@ auth: # Use an existing Kubernetes secret for the MEILI_MASTER_KEY existingMasterKeySecret: "" +envFrom: [] + serviceAccount: # You can use a specific pre-created service account instead of # the one created by this chart.