summaryrefslogtreecommitdiffstats
path: root/kubernetes/aai/charts/aai-elasticsearch/resources/bin
diff options
context:
space:
mode:
authorEdwin Lawrance <Edwin.Lawrance@amdocs.com>2019-03-05 10:30:33 +0000
committerEdwin Lawrance <Edwin.Lawrance@amdocs.com>2019-03-05 14:55:20 +0000
commita1dd587d6a5204030bc266d371e6ec9fa7c95d7b (patch)
tree8840b7b88601ef13ea879235ec7afac51d8b2e16 /kubernetes/aai/charts/aai-elasticsearch/resources/bin
parent827c5c38d3065e469e2a9605df5b3d114ef87ba8 (diff)
Add Searchguard OOM config to ElasticSearch
Change-Id: I3c4d0c82882b2f064a6ad3610c0f699d8af50632 Issue-ID: AAI-2203 Signed-off-by: Edwin Lawrance <Edwin.Lawrance@amdocs.com>
Diffstat (limited to 'kubernetes/aai/charts/aai-elasticsearch/resources/bin')
-rw-r--r--kubernetes/aai/charts/aai-elasticsearch/resources/bin/init_sg.sh11
-rw-r--r--kubernetes/aai/charts/aai-elasticsearch/resources/bin/run.sh8
-rw-r--r--kubernetes/aai/charts/aai-elasticsearch/resources/bin/wait_until_started.sh9
3 files changed, 28 insertions, 0 deletions
diff --git a/kubernetes/aai/charts/aai-elasticsearch/resources/bin/init_sg.sh b/kubernetes/aai/charts/aai-elasticsearch/resources/bin/init_sg.sh
new file mode 100644
index 0000000000..e85936570e
--- /dev/null
+++ b/kubernetes/aai/charts/aai-elasticsearch/resources/bin/init_sg.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+/usr/share/elasticsearch/plugins/search-guard-6/tools/sgadmin.sh \
+ -cd /usr/share/elasticsearch/config/sg \
+ -ks /usr/share/elasticsearch/config/sg/auth/{{ .Values.config.adminKeyStore }} \
+ -ts /usr/share/elasticsearch/config/sg/auth/{{ .Values.config.trustStore }} \
+ -kspass {{ .Values.config.adminKeyStorePassword }} \
+ -tspass {{ .Values.config.trustStorePassword}} \
+ -nhnv \
+ -icl \
+ -p {{ .Values.service.internalPort2 }} \ No newline at end of file
diff --git a/kubernetes/aai/charts/aai-elasticsearch/resources/bin/run.sh b/kubernetes/aai/charts/aai-elasticsearch/resources/bin/run.sh
new file mode 100644
index 0000000000..a612c74a1c
--- /dev/null
+++ b/kubernetes/aai/charts/aai-elasticsearch/resources/bin/run.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# Wait for ES to start then initialize SearchGuard
+/usr/local/bin/docker-entrypoint.sh eswrapper &
+/usr/share/elasticsearch/bin/wait_until_started.sh
+/usr/share/elasticsearch/bin/init_sg.sh
+
+wait \ No newline at end of file
diff --git a/kubernetes/aai/charts/aai-elasticsearch/resources/bin/wait_until_started.sh b/kubernetes/aai/charts/aai-elasticsearch/resources/bin/wait_until_started.sh
new file mode 100644
index 0000000000..279253b43d
--- /dev/null
+++ b/kubernetes/aai/charts/aai-elasticsearch/resources/bin/wait_until_started.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+RET=1
+
+while [[ RET -ne 0 ]]; do
+ echo "Waiting for Elasticsearch to become ready before running sgadmin..."
+ curl -XGET -k "https://localhost:{{ .Values.service.internalPort }}/" >/dev/null 2>&1
+ RET=$?
+ sleep 5
+done \ No newline at end of file