From ce50fd1c634d8a814cef2bbc300e0fe5330ad3f8 Mon Sep 17 00:00:00 2001 From: salaboy Date: Tue, 10 Sep 2019 13:40:02 +0200 Subject: [PATCH 1/3] adding Example for Kubernetes KIND --- elasticsearch/README.md | 9 +++++ .../examples/kubernetes-kind/Makefile | 12 ++++++ .../examples/kubernetes-kind/values.yaml | 37 +++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 elasticsearch/examples/kubernetes-kind/Makefile create mode 100644 elasticsearch/examples/kubernetes-kind/values.yaml diff --git a/elasticsearch/README.md b/elasticsearch/README.md index 7ac117df6..eaa55f675 100644 --- a/elasticsearch/README.md +++ b/elasticsearch/README.md @@ -258,6 +258,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..f237db383 --- /dev/null +++ b/elasticsearch/examples/kubernetes-kind/values.yaml @@ -0,0 +1,37 @@ +--- +# 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 +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 + From 29a465fef1ed0d233e7da4340c7723cd07d8d07b Mon Sep 17 00:00:00 2001 From: salaboy Date: Mon, 23 Sep 2019 11:19:24 +0100 Subject: [PATCH 2/3] updating storageClassName --- elasticsearch/examples/kubernetes-kind/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elasticsearch/examples/kubernetes-kind/values.yaml b/elasticsearch/examples/kubernetes-kind/values.yaml index f237db383..574779fdd 100644 --- a/elasticsearch/examples/kubernetes-kind/values.yaml +++ b/elasticsearch/examples/kubernetes-kind/values.yaml @@ -17,7 +17,7 @@ resources: # Request smaller persistent volumes. volumeClaimTemplate: accessModes: [ "ReadWriteOnce" ] - storageClassName: "hostpath" + storageClassName: "standard" resources: requests: storage: 100M From f8bdd1241a05fb54d283970a226be2a60910679d Mon Sep 17 00:00:00 2001 From: salaboy Date: Tue, 24 Sep 2019 15:45:27 +0100 Subject: [PATCH 3/3] Update values.yaml --- elasticsearch/examples/kubernetes-kind/values.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/elasticsearch/examples/kubernetes-kind/values.yaml b/elasticsearch/examples/kubernetes-kind/values.yaml index 574779fdd..15f667173 100644 --- a/elasticsearch/examples/kubernetes-kind/values.yaml +++ b/elasticsearch/examples/kubernetes-kind/values.yaml @@ -17,7 +17,6 @@ resources: # Request smaller persistent volumes. volumeClaimTemplate: accessModes: [ "ReadWriteOnce" ] - storageClassName: "standard" resources: requests: storage: 100M