From 7b73ecc57ddefae553bd963480f2054ff4cb54dd Mon Sep 17 00:00:00 2001 From: Naseem Date: Tue, 14 Jan 2020 00:25:06 -0500 Subject: [PATCH] Add commented out example of a useful post start hook This post start lifecycle hook will configure templates if not using logstash/filebeat, but rather something does not support managing templates (at the time of this commit) such as fluent bit --- elasticsearch/values.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/elasticsearch/values.yaml b/elasticsearch/values.yaml index c667444fa..a695a4261 100755 --- a/elasticsearch/values.yaml +++ b/elasticsearch/values.yaml @@ -233,7 +233,19 @@ lifecycle: {} # command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"] # postStart: # exec: - # command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"] + # command: + # - bash + # - -c + # - | + # #!/bin/bash + # # Add a template to adjust number of shards/replicas + # TEMPLATE_NAME=my_template + # INDEX_PATTERN="logstash-*" + # SHARD_COUNT=8 + # REPLICA_COUNT=1 + # ES_URL=http://localhost:9200 + # while [[ "$(curl -s -o /dev/null -w '%{http_code}\n' $ES_URL)" != "200" ]]; do sleep 1; done + # curl -XPUT "$ES_URL/_template/$TEMPLATE_NAME" -H 'Content-Type: application/json' -d'{"index_patterns":['\""$INDEX_PATTERN"\"'],"settings":{"number_of_shards":'$SHARD_COUNT',"number_of_replicas":'$REPLICA_COUNT'}}' sysctlInitContainer: enabled: true