Skip to content
Merged
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
10 changes: 5 additions & 5 deletions drupal/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ dependencies:
version: 7.5.2
- name: memcached
repository: https://charts.bitnami.com/bitnami
version: 4.2.19
version: 4.2.20
- name: mailhog
repository: https://codecentric.github.io/helm-charts
version: 3.1.3
- name: elasticsearch
repository: https://helm.elastic.co
version: 7.8.0
repository: file://../elasticsearch
version: 7.8.1
- name: silta-release
repository: file://../silta-release
version: 0.1.1
digest: sha256:98be0b4e0037546f1c26e2dc7509dc178dc7e9d9eac5432abceca68e93bc9549
generated: "2020-07-06T10:06:16.920403+02:00"
digest: sha256:f09649fb846a605e700304ada62a833d4055918663ddccc4749e71cd55dd1fa9
generated: "2020-07-16T15:38:14.672329+02:00"
5 changes: 3 additions & 2 deletions drupal/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: drupal
version: 0.3.47
version: 0.3.48
apiVersion: v2
dependencies:
- name: mariadb
Expand All @@ -17,7 +17,8 @@ dependencies:
condition: mailhog.enabled
- name: elasticsearch
version: 7.8.x
repository: https://helm.elastic.co
# repository: https://helm.elastic.co
repository: file://../elasticsearch
condition: elasticsearch.enabled
- name: silta-release
version: 0.1.1
Expand Down
2 changes: 2 additions & 0 deletions elasticsearch/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tests/
.pytest_cache/
12 changes: 12 additions & 0 deletions elasticsearch/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
description: Official Elastic helm chart for Elasticsearch
home: https://github.com/elastic/helm-charts
maintainers:
- email: helm-charts@elastic.co
name: Elastic
name: elasticsearch
version: 7.8.1
appVersion: 7.8.1
sources:
- https://github.com/elastic/elasticsearch
icon: https://helm.elastic.co/icons/elasticsearch.png
1 change: 1 addition & 0 deletions elasticsearch/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../helpers/common.mk
458 changes: 458 additions & 0 deletions elasticsearch/README.md

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions elasticsearch/examples/config/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
default: test
include ../../../helpers/examples.mk

RELEASE := helm-es-config

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

secrets:
kubectl delete secret elastic-config-credentials elastic-config-secret elastic-config-slack elastic-config-custom-path || true
kubectl create secret generic elastic-config-credentials --from-literal=password=changeme --from-literal=username=elastic
kubectl create secret generic elastic-config-slack --from-literal=xpack.notification.slack.account.monitoring.secure_url='https://hooks.slack.com/services/asdasdasd/asdasdas/asdasd'
kubectl create secret generic elastic-config-secret --from-file=xpack.watcher.encryption_key=./watcher_encryption_key
kubectl create secret generic elastic-config-custom-path --from-literal=slack_url='https://hooks.slack.com/services/asdasdasd/asdasdas/asdasd' --from-literal=thing_i_don_tcare_about=test

test: secrets install goss

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

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


## Usage

* Create the required secrets: `make secrets`

* Deploy Elasticsearch chart with the default values: `make install`

* You can now setup a port forward to query Elasticsearch API:

```
kubectl port-forward svc/config-master 9200
curl -u elastic:changeme http://localhost:9200/_cat/indices
```


## Testing

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
26 changes: 26 additions & 0 deletions elasticsearch/examples/config/test/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
http:
http://localhost:9200/_cluster/health:
status: 200
timeout: 2000
body:
- 'green'
- '"number_of_nodes":1'
- '"number_of_data_nodes":1'

http://localhost:9200:
status: 200
timeout: 2000
body:
- '"cluster_name" : "config"'
- '"name" : "config-master-0"'
- 'You Know, for Search'

command:
"elasticsearch-keystore list":
exit-status: 0
stdout:
- keystore.seed
- bootstrap.password
- xpack.notification.slack.account.monitoring.secure_url
- xpack.notification.slack.account.otheraccount.secure_url
- xpack.watcher.encryption_key
31 changes: 31 additions & 0 deletions elasticsearch/examples/config/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---

clusterName: "config"
replicas: 1

extraEnvs:
- name: ELASTIC_PASSWORD
valueFrom:
secretKeyRef:
name: elastic-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: |
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
1 change: 1 addition & 0 deletions elasticsearch/examples/config/watcher_encryption_key
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
supersecret
16 changes: 16 additions & 0 deletions elasticsearch/examples/default/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
default: test

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

RELEASE := helm-es-default

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

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

test: install goss

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

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


## Usage

* Deploy Elasticsearch chart with the default values: `make install`

* You can now setup a port forward to query Elasticsearch API:

```
kubectl port-forward svc/elasticsearch-master 9200
curl localhost:9200/_cat/indices
```


## Testing

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
19 changes: 19 additions & 0 deletions elasticsearch/examples/default/rolling_upgrade.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash -x

kubectl proxy || true &

make &
PROC_ID=$!

while kill -0 "$PROC_ID" >/dev/null 2>&1; do
echo "PROCESS IS RUNNING"
if curl --fail 'http://localhost:8001/api/v1/proxy/namespaces/default/services/elasticsearch-master:9200/_search' ; then
echo "cluster is healthy"
else
echo "cluster not healthy!"
exit 1
fi
sleep 1
done
echo "PROCESS TERMINATED"
exit 0
39 changes: 39 additions & 0 deletions elasticsearch/examples/default/test/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
kernel-param:
vm.max_map_count:
value: '262144'

http:
http://elasticsearch-master:9200/_cluster/health:
status: 200
timeout: 2000
body:
- 'green'
- '"number_of_nodes":3'
- '"number_of_data_nodes":3'

http://localhost:9200:
status: 200
timeout: 2000
body:
- '"number" : "7.8.1-SNAPSHOT"'
- '"cluster_name" : "elasticsearch"'
- '"name" : "elasticsearch-master-0"'
- 'You Know, for Search'

file:
/usr/share/elasticsearch/data:
exists: true
mode: "2775"
owner: root
group: elasticsearch
filetype: directory

mount:
/usr/share/elasticsearch/data:
exists: true

user:
elasticsearch:
exists: true
uid: 1000
gid: 1000
12 changes: 12 additions & 0 deletions elasticsearch/examples/docker-for-mac/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
default: test

RELEASE := helm-es-docker-for-mac

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

test: install
helm test $(RELEASE)

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

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

Note that this configuration should be used for test only and isn't recommended
for production.


## Usage

* Deploy Elasticsearch chart with the default values: `make install`

* You can now setup a port forward to query Elasticsearch API:

```
kubectl port-forward svc/elasticsearch-master 9200
curl localhost:9200/_cat/indices
```


[custom values]: https://github.com/elastic/helm-charts/tree/7.8/elasticsearch/examples/docker-for-mac/values.yaml
[docker for mac]: https://docs.docker.com/docker-for-mac/kubernetes/
23 changes: 23 additions & 0 deletions elasticsearch/examples/docker-for-mac/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
# Permit co-located instances for solitary minikube virtual machines.
antiAffinity: "soft"

# Shrink default JVM heap.
esJavaOpts: "-Xmx128m -Xms128m"

# Allocate smaller chunks of memory per pod.
resources:
requests:
cpu: "100m"
memory: "512M"
limits:
cpu: "1000m"
memory: "512M"

# Request smaller persistent volumes.
volumeClaimTemplate:
accessModes: [ "ReadWriteOnce" ]
storageClassName: "hostpath"
resources:
requests:
storage: 100M
16 changes: 16 additions & 0 deletions elasticsearch/examples/kubernetes-kind/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
default: test

RELEASE := helm-es-kind

install:
helm upgrade --wait --timeout=900 --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) ../../

test: install
helm test $(RELEASE)

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

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

Note that this configuration should be used for test only and isn't recommended
for production.

Note that Kind < 0.7.0 are affected by a [kind issue][] with mount points
created from PVCs not writable by non-root users. [kubernetes-sigs/kind#1157][]
fix it in Kind 0.7.0.

The workaround for Kind < 0.7.0 is to install manually
[Rancher Local Path Provisioner][] and use `local-path` storage class for
Elasticsearch volumes (see [Makefile][] instructions).


## Usage

* For Kind >= 0.7.0: Deploy Elasticsearch chart with the default values: `make install`
* For Kind < 0.7.0: Deploy Elasticsearch chart with `local-path` storage class: `make install-local-path`

* You can now setup a port forward to query Elasticsearch API:

```
kubectl port-forward svc/elasticsearch-master 9200
curl localhost:9200/_cat/indices
```


[custom values]: https://github.com/elastic/helm-charts/blob/7.8/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
Loading