mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
[incubator/solr] Allow adding a custom script to be run before starting Solr (using the entry point of the official Solr Docker Image) (#21598)
* Allow adding a custom script to be run before starting Solr Signed-off-by: John Bai <pikapai@gmail.com> * Allow adding a custom script to be run before starting Solr Signed-off-by: John Bai <pikapai@gmail.com> * Update incubator/solr/Chart.yaml Bump version for new features Co-Authored-By: Carlos Tadeu Panato Junior <ctadeu@gmail.com> Signed-off-by: John Bai <pikapai@gmail.com> Co-authored-by: Carlos Tadeu Panato Junior <ctadeu@gmail.com>
This commit is contained in:
co-authored by
Carlos Tadeu Panato Junior
parent
b41d0e5eea
commit
886cac277e
@@ -2,7 +2,7 @@
|
||||
|
||||
apiVersion: "v1"
|
||||
name: "solr"
|
||||
version: "1.4.0"
|
||||
version: "1.5.0"
|
||||
appVersion: "8.4.0"
|
||||
description: "A helm chart to install Apache Solr: http://lucene.apache.org/solr/"
|
||||
keywords:
|
||||
|
||||
@@ -31,6 +31,8 @@ The following table shows the configuration options for the Solr helm chart:
|
||||
| `javaMem` | JVM memory settings to pass to Solr | `-Xms2g -Xmx3g` |
|
||||
| `resources` | Resource limits and requests to set on the solr pods | `{}` |
|
||||
| `extraEnvVars` | Additional environment variables to set on the solr pods (in yaml syntax) | `[]` |
|
||||
| `initScript` | The file name of the custom script to be run before starting Solr | `""` |
|
||||
|
||||
| `terminationGracePeriodSeconds` | The termination grace period of the Solr pods | `180`|
|
||||
| `image.repository` | The repository to pull the docker image from| `solr` |
|
||||
| `image.tag` | The tag on the repository to pull | `7.7.2` |
|
||||
|
||||
@@ -80,6 +80,13 @@ Create chart name and version as used by the chart label.
|
||||
{{- printf "%s-%s" (include "solr.fullname" .) "config-map" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Define the name of the custom script configmap
|
||||
*/}}
|
||||
{{- define "solr.custom-script.configmap-name" -}}
|
||||
{{- printf "%s-%s" (include "solr.fullname" .) "custom-script-config-map" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Define the labels that should be applied to all resources in the chart
|
||||
*/}}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{{ if not ( eq .Values.initScript "" ) }}
|
||||
---
|
||||
|
||||
apiVersion: "v1"
|
||||
kind: "ConfigMap"
|
||||
metadata:
|
||||
name: "{{ include "solr.custom-script.configmap-name" . }}"
|
||||
labels:
|
||||
{{ include "solr.common.labels" . | indent 4}}
|
||||
data:
|
||||
solr-init.sh: |
|
||||
{{ .Files.Get .Values.initScript | indent 4}}
|
||||
{{ end }}
|
||||
@@ -55,6 +55,14 @@ spec:
|
||||
items:
|
||||
- key: solr.xml
|
||||
path: solr.xml
|
||||
{{- if not ( eq .Values.initScript "" ) }}
|
||||
- name: solr-init-script
|
||||
configMap:
|
||||
name: {{ include "solr.custom-script.configmap-name" . }}
|
||||
items:
|
||||
- key: solr-init.sh
|
||||
path: solr-init.sh
|
||||
{{- end }}
|
||||
initContainers:
|
||||
- name: check-zk
|
||||
image: busybox:latest
|
||||
@@ -199,6 +207,10 @@ spec:
|
||||
volumeMounts:
|
||||
- name: {{ include "solr.pvc-name" . }}
|
||||
mountPath: /opt/solr/server/home
|
||||
{{- if not ( eq .Values.initScript "" ) }}
|
||||
- name: solr-init-script
|
||||
mountPath: /docker-entrypoint-initdb.d
|
||||
{{- end }}
|
||||
{{ if .Values.tls.enabled }}
|
||||
- name: "keystore-volume"
|
||||
mountPath: "/etc/ssl/keystores"
|
||||
|
||||
@@ -22,6 +22,10 @@ resources: {}
|
||||
# Extra environment variables - allows yaml definitions
|
||||
extraEnvVars: []
|
||||
|
||||
# Specify the initial script file name here to be executed before starting Solr
|
||||
# The file is located relative to the solr chart root folder
|
||||
initScript: ""
|
||||
|
||||
# Sets the termination Grace period for the solr pods
|
||||
# This can take a while for shards to elect new leaders
|
||||
terminationGracePeriodSeconds: 180
|
||||
|
||||
Reference in New Issue
Block a user