diff --git a/elasticsearch/README.md b/elasticsearch/README.md index ab9fe7f2d..e17a4d677 100644 --- a/elasticsearch/README.md +++ b/elasticsearch/README.md @@ -262,6 +262,15 @@ cd examples/docker-for-mac make ``` +#### KIND - Kubernetes + +It is also possible to run this chart using a Kubernetes [KIND (Kubernetes in Docker)](https://github.com/kubernetes-sigs/kind) cluster: + +``` +cd examples/kubernetes-kind +make +``` + ## Clustering and Node Discovery This chart facilitates Elasticsearch node discovery and services by creating two `Service` definitions in Kubernetes, one with the name `$clusterName-$nodeGroup` and another named `$clusterName-$nodeGroup-headless`. diff --git a/elasticsearch/examples/kubernetes-kind/Makefile b/elasticsearch/examples/kubernetes-kind/Makefile new file mode 100644 index 000000000..c0a0f8d40 --- /dev/null +++ b/elasticsearch/examples/kubernetes-kind/Makefile @@ -0,0 +1,12 @@ +default: test + +RELEASE := helm-es-kind + +install: + helm upgrade --wait --timeout=900 --install --values values.yaml $(RELEASE) ../../ + +test: install + helm test $(RELEASE) + +purge: + helm del --purge $(RELEASE) diff --git a/elasticsearch/examples/kubernetes-kind/values.yaml b/elasticsearch/examples/kubernetes-kind/values.yaml new file mode 100644 index 000000000..15f667173 --- /dev/null +++ b/elasticsearch/examples/kubernetes-kind/values.yaml @@ -0,0 +1,36 @@ +--- +# 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" ] + resources: + requests: + storage: 100M +extraInitContainers: | + - name: create + image: busybox:1.28 + command: ['mkdir', '/usr/share/elasticsearch/data/nodes/'] + volumeMounts: + - mountPath: /usr/share/elasticsearch/data + name: elasticsearch-master + - name: file-permissions + image: busybox:1.28 + command: ['chown', '-R', '1000:1000', '/usr/share/elasticsearch/'] + volumeMounts: + - mountPath: /usr/share/elasticsearch/data + name: elasticsearch-master +