From 926b8a7cd58f65cef55473f1105fda77517717e2 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Tue, 21 May 2024 14:09:01 -0700 Subject: [PATCH] feat(datahub-upgrade): allow specifying index settings as a map (#465) --- charts/datahub/Chart.yaml | 2 +- .../datahub-system-update-job.yml | 20 +++++++++++++++++++ charts/datahub/values.yaml | 10 ++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/charts/datahub/Chart.yaml b/charts/datahub/Chart.yaml index e124ee640..c38b0f43a 100644 --- a/charts/datahub/Chart.yaml +++ b/charts/datahub/Chart.yaml @@ -4,7 +4,7 @@ description: A Helm chart for LinkedIn DataHub type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 0.4.11 +version: 0.4.12 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. appVersion: 0.13.2 diff --git a/charts/datahub/templates/datahub-upgrade/datahub-system-update-job.yml b/charts/datahub/templates/datahub-upgrade/datahub-system-update-job.yml index d28248b07..5aac33c8e 100644 --- a/charts/datahub/templates/datahub-upgrade/datahub-system-update-job.yml +++ b/charts/datahub/templates/datahub-upgrade/datahub-system-update-job.yml @@ -109,13 +109,23 @@ spec: value: {{ . | quote }} {{- end }} {{- with .Values.global.elasticsearch.index.settingsOverrides }} + {{- if typeIs "map[string]interface {}" . }} + - name: ELASTICSEARCH_INDEX_BUILDER_SETTINGS_OVERRIDES + value: {{ toJson . | quote }} + {{- else }} - name: ELASTICSEARCH_INDEX_BUILDER_SETTINGS_OVERRIDES value: {{ . | quote }} {{- end }} + {{- end }} {{- with .Values.global.elasticsearch.index.entitySettingsOverrides }} + {{- if typeIs "map[string]interface {}" . }} + - name: ELASTICSEARCH_INDEX_BUILDER_ENTITY_SETTINGS_OVERRIDES + value: {{ toJson . | quote }} + {{- else }} - name: ELASTICSEARCH_INDEX_BUILDER_ENTITY_SETTINGS_OVERRIDES value: {{ . | quote }} {{- end }} + {{- end }} {{- with .Values.global.elasticsearch.index.refreshIntervalSeconds }} - name: ELASTICSEARCH_INDEX_BUILDER_REFRESH_INTERVAL_SECONDS value: {{ . | quote }} @@ -261,13 +271,23 @@ spec: value: {{ . | quote }} {{- end }} {{- with .Values.global.elasticsearch.index.settingsOverrides }} + {{- if typeIs "map[string]interface {}" . }} + - name: ELASTICSEARCH_INDEX_BUILDER_SETTINGS_OVERRIDES + value: {{ toJson . | quote }} + {{- else }} - name: ELASTICSEARCH_INDEX_BUILDER_SETTINGS_OVERRIDES value: {{ . | quote }} {{- end }} + {{- end }} {{- with .Values.global.elasticsearch.index.entitySettingsOverrides }} + {{- if typeIs "map[string]interface {}" . }} + - name: ELASTICSEARCH_INDEX_BUILDER_ENTITY_SETTINGS_OVERRIDES + value: {{ toJson . | quote }} + {{- else }} - name: ELASTICSEARCH_INDEX_BUILDER_ENTITY_SETTINGS_OVERRIDES value: {{ . | quote }} {{- end }} + {{- end }} {{- with .Values.global.elasticsearch.index.refreshIntervalSeconds }} - name: ELASTICSEARCH_INDEX_BUILDER_REFRESH_INTERVAL_SECONDS value: {{ . | quote }} diff --git a/charts/datahub/values.yaml b/charts/datahub/values.yaml index cfa81dec7..760033491 100644 --- a/charts/datahub/values.yaml +++ b/charts/datahub/values.yaml @@ -431,8 +431,18 @@ global: ## Index settings can be overridden for entity indices or other indices on an index by index basis ## Some index settings, such as # of shards, requires reindexing while others, i.e. replicas, do not + ## The index settings options can be specified as a string or a map (which is converted to a string + ## representation) + ## ## Non-Entity indices do not require the prefix # settingsOverrides: '{"graph_service_v1":{"number_of_shards":"5"},"system_metadata_service_v1":{"number_of_shards":"5"}}' + ## or + # settingsOverrides: + # graph_service_v1: + # number_of_shards: '5' + # system_metadata_service_v1: + # number_of_shards: '6' + # ## Entity indices do not require the prefix or suffix # entitySettingsOverrides: '{"dataset":{"number_of_shards":"10"}}'