From e966ae6ba8feca66525739e7587908f05ebf9583 Mon Sep 17 00:00:00 2001 From: Radhika Pai Date: Mon, 18 May 2020 09:14:56 -0500 Subject: [PATCH] Kibana: Add support for arbitrary object definitions via overrides This allows for customizing the indexes required by different deployment targets instead of assuming all indexes are common for every type of deployment. Change-Id: Iae9a35462400f7c8612ee7d0b49bfd6a20d3120c --- .../templates/bin/_create_kibana_index_patterns.sh.tpl | 7 ++++--- kibana/values.yaml | 10 ++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/kibana/templates/bin/_create_kibana_index_patterns.sh.tpl b/kibana/templates/bin/_create_kibana_index_patterns.sh.tpl index 51703fbab..2520b939b 100644 --- a/kibana/templates/bin/_create_kibana_index_patterns.sh.tpl +++ b/kibana/templates/bin/_create_kibana_index_patterns.sh.tpl @@ -14,13 +14,14 @@ limitations under the License. */}} set -ex -{{- range .Values.conf.create_kibana_indexes.indexes }} +{{- range $objectType, $indices := .Values.conf.create_kibana_indexes.indexes }} +{{- range $indices }} curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \ -XPOST "${KIBANA_ENDPOINT}/api/saved_objects/index-pattern/{{ . }}*" -H 'kbn-xsrf: true' \ -H 'Content-Type: application/json' -d \ '{"attributes":{"title":"{{ . }}-*","timeFieldName":"@timestamp"}}' - -{{ end }} +{{- end }} +{{- end }} curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \ -XPOST "${KIBANA_ENDPOINT}/api/kibana/settings/defaultIndex" -H 'kbn-xsrf: true' \ diff --git a/kibana/values.yaml b/kibana/values.yaml index 767bbdb29..27de90d4e 100644 --- a/kibana/values.yaml +++ b/kibana/values.yaml @@ -280,10 +280,12 @@ conf: enabled: true version: 7.1.0 indexes: - - logstash - - openstack - - journal - - kernel + base: + - logstash + - journal + - kernel + application: + - openstack default_index: logstash endpoints: