Skip to content
This repository was archived by the owner on Aug 30, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions stable/elasticsearch/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
apiVersion: v1
name: elasticsearch
home: https://www.elastic.co/products/elasticsearch
version: 1.22.0
appVersion: 6.7.0
description: Flexible and powerful open source, distributed real-time search and analytics
version: 1.32.6
appVersion: 6.8.22
# The elasticsearch chart is deprecated and no longer maintained. For details deprecation, see the PROCESSES.md file.
deprecated: true
description: DEPRECATED Flexible and powerful open source, distributed real-time search and analytics
engine.
icon: https://static-www.elastic.co/assets/blteb1c97719574938d/logo-elastic-elasticsearch-lt.svg
sources:
Expand All @@ -12,12 +15,4 @@ sources:
- https://github.com/GoogleCloudPlatform/elasticsearch-docker
- https://github.com/clockworksoul/helm-elasticsearch
- https://github.com/pires/kubernetes-elasticsearch-cluster
maintainers:
- name: simonswine
email: [email protected]
- name: icereval
email: [email protected]
- name: rendhalver
email: [email protected]
- name: desaintmartin
email: [email protected]
maintainers: []
10 changes: 0 additions & 10 deletions stable/elasticsearch/OWNERS

This file was deleted.

44 changes: 37 additions & 7 deletions stable/elasticsearch/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
# Expose transport port on ClusterIP service

client:
exposeTransportPort: true
31 changes: 31 additions & 0 deletions stable/elasticsearch/ci/hooks-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
# Enable custom lifecycle hooks for client, data and master pods

client:
hooks:
preStop: |-
#!/bin/bash
echo "Node {{ template "elasticsearch.client.fullname" . }} is shutting down"
postStart: |-
#!/bin/bash
echo "Node {{ template "elasticsearch.client.fullname" . }} is ready to be used"

data:
hooks:
drain:
enabled: false
preStop: |-
#!/bin/bash
echo "Node {{ template "elasticsearch.data.fullname" . }} is shutting down"
postStart: |-
#!/bin/bash
echo "Node {{ template "elasticsearch.data.fullname" . }} is ready to be used"

master:
hooks:
preStop: |-
#!/bin/bash
echo "Node {{ template "elasticsearch.master.fullname" . }} is shutting down"
postStart: |-
#!/bin/bash
echo "Node {{ template "elasticsearch.master.fullname" . }} is ready to be used"
12 changes: 12 additions & 0 deletions stable/elasticsearch/ci/nonroot-deployment-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# Deploy Chart as non-root and unprivileged

chownInitContainer:
enabled: false

securityContext:
enabled: true
runAsUser: 1000

sysctlInitContainer:
enabled: false
7 changes: 7 additions & 0 deletions stable/elasticsearch/ci/updatestrategy-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data:
updateStrategy:
type: RollingUpdate

master:
updateStrategy:
type: RollingUpdate
4 changes: 4 additions & 0 deletions stable/elasticsearch/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
This Helm chart is deprecated. Please use https://github.com/elastic/helm-charts/tree/master/elasticsearch instead.

---

The elasticsearch cluster has been installed.

Elasticsearch can be accessed:
Expand Down
8 changes: 7 additions & 1 deletion stable/elasticsearch/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ plugin installer template
- "-c"
- |
{{- range .Values.cluster.plugins }}
/usr/share/elasticsearch/bin/elasticsearch-plugin install -b {{ . }}
PLUGIN_NAME="{{ . }}"
echo "Installing $PLUGIN_NAME..."
if /usr/share/elasticsearch/bin/elasticsearch-plugin list | grep "$PLUGIN_NAME" > /dev/null; then
echo "Plugin $PLUGIN_NAME already exists, skipping."
else
/usr/share/elasticsearch/bin/elasticsearch-plugin install -b $PLUGIN_NAME
fi
{{- end }}
volumeMounts:
- mountPath: /usr/share/elasticsearch/plugins/
Expand Down
40 changes: 38 additions & 2 deletions stable/elasticsearch/templates/client-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
Expand All @@ -9,15 +9,21 @@ metadata:
release: {{ .Release.Name }}
name: {{ template "elasticsearch.client.fullname" . }}
spec:
selector:
matchLabels:
app: {{ template "elasticsearch.name" . }}
component: "{{ .Values.client.name }}"
release: {{ .Release.Name }}
replicas: {{ .Values.client.replicas }}
template:
metadata:
labels:
app: {{ template "elasticsearch.name" . }}
component: "{{ .Values.client.name }}"
release: {{ .Release.Name }}
{{- if .Values.client.podAnnotations }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- if .Values.client.podAnnotations }}
{{ toYaml .Values.client.podAnnotations | indent 8 }}
{{- end }}
spec:
Expand Down Expand Up @@ -63,6 +69,9 @@ spec:
tolerations:
{{ toYaml .Values.client.tolerations | indent 8 }}
{{- end }}
{{- if .Values.client.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.client.terminationGracePeriodSeconds }}
{{- end }}
{{- if or .Values.extraInitContainers .Values.sysctlInitContainer.enabled .Values.cluster.plugins }}
initContainers:
{{- if .Values.sysctlInitContainer.enabled }}
Expand Down Expand Up @@ -121,6 +130,10 @@ spec:
initialDelaySeconds: 90
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
{{- if .Values.securityContext.enabled }}
securityContext:
runAsUser: {{ .Values.securityContext.runAsUser }}
{{- end }}
ports:
- containerPort: 9200
name: http
Expand Down Expand Up @@ -150,6 +163,29 @@ spec:
subPath: elasticsearch.keystore
readOnly: true
{{- end }}
{{- if .Values.client.hooks.preStop }}
- name: config
mountPath: /client-pre-stop-hook.sh
subPath: client-pre-stop-hook.sh
{{- end }}
{{- if .Values.client.hooks.postStart }}
- name: config
mountPath: /client-post-start-hook.sh
subPath: client-post-start-hook.sh
{{- end }}
{{- if or .Values.client.hooks.preStop .Values.client.hooks.postStart }}
lifecycle:
{{- if .Values.client.hooks.preStop }}
preStop:
exec:
command: ["/bin/bash","/client-pre-stop-hook.sh"]
{{- end }}
{{- if .Values.client.hooks.postStart }}
postStart:
exec:
command: ["/bin/bash","/client-post-start-hook.sh"]
{{- end }}
{{- end }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range $pullSecret := .Values.image.pullSecrets }}
Expand Down
2 changes: 1 addition & 1 deletion stable/elasticsearch/templates/client-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ metadata:
component: "{{ .Values.client.name }}"
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- with .Values.client.ingress.annotations }}
annotations:
{{- with .Values.client.ingress.annotations }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- if and ( .Values.client.ingress.user ) ( .Values.client.ingress.password ) }}
Expand Down
8 changes: 8 additions & 0 deletions stable/elasticsearch/templates/client-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ spec:
ports:
- name: http
port: 9200
{{- if and .Values.client.httpNodePort (eq .Values.client.serviceType "NodePort") }}
nodePort: {{ .Values.client.httpNodePort }}
{{- end }}
targetPort: http
{{- if .Values.client.exposeTransportPort }}
- name: transport
port: 9300
targetPort: transport
{{- end }}
selector:
app: {{ template "elasticsearch.name" . }}
component: "{{ .Values.client.name }}"
Expand Down
73 changes: 36 additions & 37 deletions stable/elasticsearch/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ data:
{{- end }}
node.name: ${HOSTNAME}

{{- if .Values.forceIpv6 }}
network.host: "::"
{{- else }}
network.host: 0.0.0.0
{{- end }}

{{- if hasPrefix "2." .Values.appVersion }}
# see https://github.com/kubernetes/kubernetes/issues/3595
Expand Down Expand Up @@ -92,45 +96,13 @@ data:
{{- end }}
{{- if hasPrefix "2." .Values.appVersion }}
logging.yml: |-
# you can override this using by setting a system property, for example -Des.logger.level=DEBUG
es.logger.level: INFO
rootLogger: ${es.logger.level}, console
logger:
# log action execution errors for easier debugging
action: DEBUG
# reduce the logging for aws, too much is logged under the default INFO
com.amazonaws: WARN
appender:
console:
type: console
layout:
type: consolePattern
conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n"
{{- else if hasPrefix "5." .Values.appVersion }}
log4j2.properties: |-
status = error
appender.console.type = Console
appender.console.name = console
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n
rootLogger.level = info
rootLogger.appenderRef.console.ref = console
logger.searchguard.name = com.floragunn
logger.searchguard.level = info
{{- else if hasPrefix "6." .Values.appVersion }}
{{ toYaml .Values.cluster.loggingYml | indent 4 }}
{{- else }}
log4j2.properties: |-
status = error
appender.console.type = Console
appender.console.name = console
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n
rootLogger.level = info
rootLogger.appenderRef.console.ref = console
logger.searchguard.name = com.floragunn
logger.searchguard.level = info
{{ tpl .Values.cluster.log4j2Properties . | indent 4 }}
{{- end }}
{{- if .Values.data.hooks.drain.enabled }}
pre-stop-hook.sh: |-
data-pre-stop-hook.sh: |-
#!/bin/bash
exec &> >(tee -a "/var/log/elasticsearch-hooks.log")
NODE_NAME=${HOSTNAME}
Expand All @@ -152,7 +124,7 @@ data:
sleep 1
done
echo "Node ${NODE_NAME} is ready to shutdown"
post-start-hook.sh: |-
data-post-start-hook.sh: |-
#!/bin/bash
exec &> >(tee -a "/var/log/elasticsearch-hooks.log")
NODE_NAME=${HOSTNAME}
Expand All @@ -166,4 +138,31 @@ data:
}"
fi
echo "Node ${NODE_NAME} is ready to be used"
{{- else }}
{{- if .Values.data.hooks.preStop }}
data-pre-stop-hook.sh: |-
{{ tpl .Values.data.hooks.preStop . | indent 4 }}
{{- end }}
{{- if .Values.data.hooks.postStart }}
data-post-start-hook.sh: |-
{{ tpl .Values.data.hooks.postStart . | indent 4 }}
{{- end }}
{{- end }}

{{- if .Values.client.hooks.preStop }}
client-pre-stop-hook.sh: |-
{{ tpl .Values.client.hooks.preStop . | indent 4 }}
{{- end }}
{{- if .Values.client.hooks.postStart }}
client-post-start-hook.sh: |-
{{ tpl .Values.client.hooks.postStart . | indent 4 }}
{{- end }}

{{- if .Values.master.hooks.preStop }}
master-pre-stop-hook.sh: |-
{{ tpl .Values.master.hooks.preStop . | indent 4 }}
{{- end }}
{{- if .Values.master.hooks.postStart }}
master-post-start-hook.sh: |-
{{ tpl .Values.master.hooks.postStart . | indent 4 }}
{{- end }}
Loading