Skip to content

Commit

Permalink
Drupal: Added support for Elasticsearch 8.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rade333 committed Aug 10, 2023
1 parent bb2d62f commit 86a13a9
Show file tree
Hide file tree
Showing 67 changed files with 1,332 additions and 852 deletions.
6 changes: 3 additions & 3 deletions drupal/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ dependencies:
version: 5.1.0
- name: elasticsearch
repository: file://../elasticsearch
version: 7.8.1
version: 8.5.1
- name: silta-release
repository: file://../silta-release
version: 0.1.1
digest: sha256:c3512a904de793d2705c98da4735d5ea3d58243442111dfcdf7c7f18b640d7b6
generated: "2023-01-26T16:58:38.528197461+02:00"
digest: sha256:4f55be5e808ff9f3cd1ed3b64640173c9633b8fd6bda08c2494ecfb687b3f9b6
generated: "2023-08-03T14:00:03.435795069+03:00"
5 changes: 3 additions & 2 deletions drupal/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ dependencies:
repository: https://codecentric.github.io/helm-charts
condition: mailhog.enabled
- name: elasticsearch
version: 7.8.x
# repository: https://helm.elastic.co
version: 8.5.x
# repository: https://helm.elastic.co
# Forked at https://github.com/elastic/helm-charts/commit/2fd64d0af65f14df7aa01da591919460dabac4b3
repository: file://../elasticsearch
condition: elasticsearch.enabled
- name: silta-release
Expand Down
2 changes: 1 addition & 1 deletion drupal/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ mysql -u $DB_USER -p$DB_PASS -h $DB_HOST -e "CREATE DATABASE IF NOT EXISTS $DB_N
{{- define "drupal.wait-for-elasticsearch-command" }}
TIME_WAITING=0
echo -n "Waiting for Elasticsearch.";
until curl --silent --connect-timeout 2 "$ELASTICSEARCH_HOST:9200" ; do
until curl --silent --connect-timeout 2 "{{ .Values.elasticsearch.protocol }}://${ELASTICSEARCH_HOST}:9200" -k ; do
echo -n "."
sleep 5
TIME_WAITING=$((TIME_WAITING+5))
Expand Down
12 changes: 12 additions & 0 deletions drupal/templates/_overrides.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ we make it compatible by overriding the following templates.
{{ .Release.Name }}-es-0
{{- end -}}

{{/*
We don't use roles for elasticsearch 6 and having them set in later
chart versions, breaks deployment. So we add conditional on it.
*/}}
{{- define "elasticsearch.roles" -}}
{{- if gt (int (include "elasticsearch.esMajorVersion" .)) 6 }}
{{- range $.Values.roles -}}
{{ . }},
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
The mariadb chart switched to an incompatible naming scheme,
we make it compatible by overriding the following templates.
Expand Down
13 changes: 12 additions & 1 deletion drupal/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ varnish:
.connect_timeout = 10s;
.between_bytes_timeout = 10s;
# https://github.com/elastic/helm-charts/blob/2fd64d0af65f14df7aa01da591919460dabac4b3/elasticsearch/values.yaml
elasticsearch:
enabled: false

Expand All @@ -589,6 +590,16 @@ elasticsearch:
maxUnavailable: 0
clusterHealthCheckParams: 'wait_for_status=yellow&timeout=1s'

# Note: "roles" definition is ignored for 6.x images due to subchart compatability reasons.

# Drupal integration module still requires non-ssl connection
# related param: elasticsearch.extraEnvs[xpack.security.enabled]
createCert: false
protocol: http
extraEnvs:
- name: xpack.security.enabled
value: "false"

# Disable service links that cause a slow startup.
enableServiceLinks: false

Expand All @@ -603,7 +614,7 @@ elasticsearch:
resources:
requests:
cpu: 200m
memory: 512Mi
memory: 640Mi
limits:
memory: 1Gi

Expand Down
10 changes: 5 additions & 5 deletions elasticsearch/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: v1
description: Official Elastic helm chart for Elasticsearch.
description: Official Elastic helm chart for Elasticsearch
home: https://github.com/elastic/helm-charts
maintainers:
- email: helm-charts@elastic.co
name: Elastic
- email: helm-charts@elastic.co
name: Elastic
name: elasticsearch
version: 7.8.1
appVersion: 7.8.1
version: 8.5.1
appVersion: 8.5.1
sources:
- https://github.com/elastic/elasticsearch
icon: https://helm.elastic.co/icons/elasticsearch.png
358 changes: 195 additions & 163 deletions elasticsearch/README.md

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions elasticsearch/examples/config/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
default: test

include ../../../helpers/examples.mk

RELEASE := helm-es-config
TIMEOUT := 1200s

install:
helm upgrade --wait --timeout=600 --install $(RELEASE) --values ./values.yaml ../../
helm upgrade --wait --timeout=$(TIMEOUT) --install --values values.yaml $(RELEASE) ../../

secrets:
kubectl delete secret elastic-config-credentials elastic-config-secret elastic-config-slack elastic-config-custom-path || true
Expand All @@ -16,4 +18,4 @@ secrets:
test: secrets install goss

purge:
helm del --purge $(RELEASE)
helm del $(RELEASE)
6 changes: 3 additions & 3 deletions elasticsearch/examples/config/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Config

This example deploy a single node Elasticsearch 7.8.1-SNAPSHOT with authentication and
This example deploy a single node Elasticsearch 8.5.1 with authentication and
custom [values][].


Expand All @@ -23,5 +23,5 @@ custom [values][].
You can also run [goss integration tests][] using `make test`


[goss integration tests]: https://github.com/elastic/helm-charts/tree/7.8/elasticsearch/examples/config/test/goss.yaml
[values]: https://github.com/elastic/helm-charts/tree/7.8/elasticsearch/examples/config/values.yaml
[goss integration tests]: https://github.com/elastic/helm-charts/tree/main/elasticsearch/examples/config/test/goss.yaml
[values]: https://github.com/elastic/helm-charts/tree/main/elasticsearch/examples/config/values.yaml
15 changes: 10 additions & 5 deletions elasticsearch/examples/config/test/goss.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
http:
http://localhost:9200/_cluster/health:
https://localhost:9200/_cluster/health:
status: 200
timeout: 2000
allow-insecure: true
username: elastic
password: "{{ .Env.ELASTIC_PASSWORD }}"
body:
- 'green'
- "green"
- '"number_of_nodes":1'
- '"number_of_data_nodes":1'

http://localhost:9200:
https://localhost:9200:
status: 200
timeout: 2000
username: elastic
allow-insecure: true
password: "{{ .Env.ELASTIC_PASSWORD }}"
body:
- '"cluster_name" : "config"'
- '"name" : "config-master-0"'
- 'You Know, for Search'
- "You Know, for Search"

command:
"elasticsearch-keystore list":
Expand Down
16 changes: 7 additions & 9 deletions elasticsearch/examples/config/values.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
---

clusterName: "config"
replicas: 1

extraEnvs:
- name: ELASTIC_PASSWORD
valueFrom:
secretKeyRef:
name: elastic-credentials
name: elastic-config-credentials
key: password
- name: ELASTIC_USERNAME
valueFrom:
secretKeyRef:
name: elastic-credentials
key: username

# This is just a dummy file to make sure that
# the keystore can be mounted at the same time
# as a custom elasticsearch.yml
esConfig:
elasticsearch.yml: |
xpack.security.enabled: true
path.data: /usr/share/elasticsearch/data
keystore:
- secretName: elastic-config-secret
- secretName: elastic-config-slack
- secretName: elastic-config-custom-path
items:
- key: slack_url
path: xpack.notification.slack.account.otheraccount.secure_url
- key: slack_url
path: xpack.notification.slack.account.otheraccount.secure_url

secret:
enabled: false
8 changes: 3 additions & 5 deletions elasticsearch/examples/default/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ default: test
include ../../../helpers/examples.mk

RELEASE := helm-es-default
TIMEOUT := 1200s

install:
helm upgrade --wait --timeout=600 --install $(RELEASE) ../../

restart:
helm upgrade --set terminationGracePeriod=121 --wait --timeout=600 --install $(RELEASE) ../../
helm upgrade --wait --timeout=$(TIMEOUT) --install $(RELEASE) ../../

test: install goss

purge:
helm del --purge $(RELEASE)
helm del $(RELEASE)
6 changes: 3 additions & 3 deletions elasticsearch/examples/default/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Default

This example deploy a 3 nodes Elasticsearch 7.8.1-SNAPSHOT cluster using
This example deploy a 3 nodes Elasticsearch 8.5.1 cluster using
[default values][].


Expand All @@ -21,5 +21,5 @@ This example deploy a 3 nodes Elasticsearch 7.8.1-SNAPSHOT cluster using
You can also run [goss integration tests][] using `make test`


[goss integration tests]: https://github.com/elastic/helm-charts/tree/7.8/elasticsearch/examples/default/test/goss.yaml
[default values]: https://github.com/elastic/helm-charts/tree/7.8/elasticsearch/values.yaml
[goss integration tests]: https://github.com/elastic/helm-charts/tree/main/elasticsearch/examples/default/test/goss.yaml
[default values]: https://github.com/elastic/helm-charts/tree/main/elasticsearch/values.yaml
19 changes: 12 additions & 7 deletions elasticsearch/examples/default/test/goss.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
kernel-param:
vm.max_map_count:
value: '262144'
value: "262144"

http:
http://elasticsearch-master:9200/_cluster/health:
https://elasticsearch-master:9200/_cluster/health:
status: 200
timeout: 2000
username: elastic
allow-insecure: true
password: "{{ .Env.ELASTIC_PASSWORD }}"
body:
- 'green'
- "green"
- '"number_of_nodes":3'
- '"number_of_data_nodes":3'

http://localhost:9200:
https://localhost:9200:
status: 200
timeout: 2000
allow-insecure: true
username: elastic
password: "{{ .Env.ELASTIC_PASSWORD }}"
body:
- '"number" : "7.8.1-SNAPSHOT"'
- '"number" : "8.5.1"'
- '"cluster_name" : "elasticsearch"'
- '"name" : "elasticsearch-master-0"'
- 'You Know, for Search'
- "You Know, for Search"

file:
/usr/share/elasticsearch/data:
Expand Down
5 changes: 3 additions & 2 deletions elasticsearch/examples/docker-for-mac/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
default: test

RELEASE := helm-es-docker-for-mac
TIMEOUT := 1200s

install:
helm upgrade --wait --timeout=900 --install --values values.yaml $(RELEASE) ../../
helm upgrade --wait --timeout=$(TIMEOUT) --install --values values.yaml $(RELEASE) ../../

test: install
helm test $(RELEASE)

purge:
helm del --purge $(RELEASE)
helm del $(RELEASE)
4 changes: 2 additions & 2 deletions elasticsearch/examples/docker-for-mac/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Docker for Mac

This example deploy a 3 nodes Elasticsearch 7.8.1-SNAPSHOT cluster on [Docker for Mac][]
This example deploy a 3 nodes Elasticsearch 8.5.1 cluster on [Docker for Mac][]
using [custom values][].

Note that this configuration should be used for test only and isn't recommended
Expand All @@ -19,5 +19,5 @@ for production.
```


[custom values]: https://github.com/elastic/helm-charts/tree/7.8/elasticsearch/examples/docker-for-mac/values.yaml
[custom values]: https://github.com/elastic/helm-charts/tree/main/elasticsearch/examples/docker-for-mac/values.yaml
[docker for mac]: https://docs.docker.com/docker-for-mac/kubernetes/
7 changes: 4 additions & 3 deletions elasticsearch/examples/kubernetes-kind/Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
default: test

RELEASE := helm-es-kind
TIMEOUT := 1200s

install:
helm upgrade --wait --timeout=900 --install --values values.yaml $(RELEASE) ../../
helm upgrade --wait --timeout=$(TIMEOUT) --install --values values.yaml $(RELEASE) ../../

install-local-path:
kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml
helm upgrade --wait --timeout=900 --install --values values-local-path.yaml $(RELEASE) ../../
helm upgrade --wait --timeout=$(TIMEOUT) --install --values values-local-path.yaml $(RELEASE) ../../

test: install
helm test $(RELEASE)

purge:
helm del --purge $(RELEASE)
helm del $(RELEASE)
6 changes: 3 additions & 3 deletions elasticsearch/examples/kubernetes-kind/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# KIND

This example deploy a 3 nodes Elasticsearch 7.8.1-SNAPSHOT cluster on [Kind][]
This example deploy a 3 nodes Elasticsearch 8.5.1 cluster on [Kind][]
using [custom values][].

Note that this configuration should be used for test only and isn't recommended
Expand Down Expand Up @@ -28,9 +28,9 @@ Elasticsearch volumes (see [Makefile][] instructions).
```


[custom values]: https://github.com/elastic/helm-charts/blob/7.8/elasticsearch/examples/kubernetes-kind/values.yaml
[custom values]: https://github.com/elastic/helm-charts/blob/main/elasticsearch/examples/kubernetes-kind/values.yaml
[kind]: https://kind.sigs.k8s.io/
[kind issue]: https://github.com/kubernetes-sigs/kind/issues/830
[kubernetes-sigs/kind#1157]: https://github.com/kubernetes-sigs/kind/pull/1157
[rancher local path provisioner]: https://github.com/rancher/local-path-provisioner
[Makefile]: https://github.com/elastic/helm-charts/blob/7.8/elasticsearch/examples/kubernetes-kind/Makefile#L5
[Makefile]: https://github.com/elastic/helm-charts/blob/main/elasticsearch/examples/kubernetes-kind/Makefile
5 changes: 3 additions & 2 deletions elasticsearch/examples/microk8s/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
default: test

RELEASE := helm-es-microk8s
TIMEOUT := 1200s

install:
helm upgrade --wait --timeout=900 --install --values values.yaml $(RELEASE) ../../
helm upgrade --wait --timeout=$(TIMEOUT) --install --values values.yaml $(RELEASE) ../../

test: install
helm test $(RELEASE)

purge:
helm del --purge $(RELEASE)
helm del $(RELEASE)
4 changes: 2 additions & 2 deletions elasticsearch/examples/microk8s/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MicroK8S

This example deploy a 3 nodes Elasticsearch 7.8.1-SNAPSHOT cluster on [MicroK8S][]
This example deploy a 3 nodes Elasticsearch 8.5.1 cluster on [MicroK8S][]
using [custom values][].

Note that this configuration should be used for test only and isn't recommended
Expand Down Expand Up @@ -28,5 +28,5 @@ The following MicroK8S [addons][] need to be enabled:


[addons]: https://microk8s.io/docs/addons
[custom values]: https://github.com/elastic/helm-charts/tree/7.8/elasticsearch/examples/microk8s/values.yaml
[custom values]: https://github.com/elastic/helm-charts/tree/main/elasticsearch/examples/microk8s/values.yaml
[MicroK8S]: https://microk8s.io
6 changes: 3 additions & 3 deletions elasticsearch/examples/migration/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
PREFIX := helm-es-migration

data:
helm upgrade --wait --timeout=600 --install --values ./data.yml $(PREFIX)-data ../../
helm upgrade --wait --timeout=$(TIMEOUT) --install --values data.yaml $(PREFIX)-data ../../

master:
helm upgrade --wait --timeout=600 --install --values ./master.yml $(PREFIX)-master ../../
helm upgrade --wait --timeout=$(TIMEOUT) --install --values master.yaml $(PREFIX)-master ../../

client:
helm upgrade --wait --timeout=600 --install --values ./client.yml $(PREFIX)-client ../../
helm upgrade --wait --timeout=$(TIMEOUT) --install --values client.yaml $(PREFIX)-client ../../
Loading

0 comments on commit 86a13a9

Please sign in to comment.