From 284eb2c7df4848b4f2ffb23868d83441b876e318 Mon Sep 17 00:00:00 2001 From: Ouahid Khelifi Date: Fri, 15 Nov 2024 12:31:03 +0100 Subject: [PATCH] fix: update helm chart with ilm rollover alias property --- helm/Chart.yaml | 7 ++- helm/templates/gateway/gateway-configmap.yaml | 1 + .../gateway/configmap_es_reporter_test.yaml | 48 +++++++++++++++++++ helm/values.yaml | 3 +- 4 files changed, 57 insertions(+), 2 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 5b38d34f86f..6e3182aa20b 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -23,4 +23,9 @@ annotations: ########### # "changes" must be the last section in this file, because a CI job clean it after each release ########### - artifacthub.io/changes: + artifacthub.io/changes: | + - kind: fixed + description: 'all users to overwrite the Elasticsearch or Opensearch rollover alias property name' + links: + - name: Github Issue + url: https://github.com/gravitee-io/issues/issues/10100 diff --git a/helm/templates/gateway/gateway-configmap.yaml b/helm/templates/gateway/gateway-configmap.yaml index b7d86f8fe7c..554a8bfb246 100644 --- a/helm/templates/gateway/gateway-configmap.yaml +++ b/helm/templates/gateway/gateway-configmap.yaml @@ -300,6 +300,7 @@ data: {{- if (eq .Values.es.lifecycle.enabled true) }} lifecycle: policy_property_name: {{ .Values.es.lifecycle.policyPropertyName }} + rollover_alias_property_name: {{ .Values.es.lifecycle.rolloverAliasPropertyName }} policies: monitor: {{ .Values.es.lifecycle.policies.monitor }} request: {{ .Values.es.lifecycle.policies.request }} diff --git a/helm/tests/gateway/configmap_es_reporter_test.yaml b/helm/tests/gateway/configmap_es_reporter_test.yaml index 5adfec3d67b..09cf68ccdbb 100644 --- a/helm/tests/gateway/configmap_es_reporter_test.yaml +++ b/helm/tests/gateway/configmap_es_reporter_test.yaml @@ -91,3 +91,51 @@ tests: bulk: actions: 1000 # Number of requests action before flush flush_interval: 5 # Flush interval in seconds + + + - it: Check override es lifecycle settings + template: gateway/gateway-configmap.yaml + set: + es: + index_mode: ilm + lifecycle: + enabled: true + policy_property_name: index.plugins.index_state_management.policy_id + rollover_alias_property_name: index.plugins.index_state_management.rollover_alias + policies: + monitor: monitor + request: request + health: health + log: log + asserts: + - hasDocuments: + count: 1 + - matchRegex: + path: data["gravitee.yml"] + pattern: | + reporters: + # Elasticsearch reporter + elasticsearch: + enabled: true + endpoints: + - http://graviteeio-apim-elasticsearch-ingest-hl:9200 + index_mode: ilm + pipeline: + plugins: + ingest: geoip, user_agent + lifecycle: + policy_property_name: index.lifecycle.name + rollover_alias_property_name: index.lifecycle.rollover_alias + policies: + monitor: monitor + request: request + health: health + log: log + index: gravitee + settings: + number_of_replicas: 1 + number_of_shards: 1 + refresh_interval: 5s + bulk: + actions: 1000 # Number of requests action before flush + flush_interval: 5 # Flush interval in seconds diff --git a/helm/values.yaml b/helm/values.yaml index a9dccbb688f..dd5a6c70595 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -321,7 +321,8 @@ es: password: example lifecycle: enabled: false - policyPropertyName: index.lifecycle.name #for openDistro, use 'opendistro.index_state_management.policy_id' instead of 'index.lifecycle.name' + policyPropertyName: index.lifecycle.name #for Opensearch, use 'index.plugins.index_state_management.policy_id' instead of 'index.lifecycle.name' + rolloverAliasPropertyName: index.lifecycle.rollover_alias #for Opensearch, use 'index.plugins.index_state_management.rollover_alias' instead of 'index.lifecycle.name' policies: monitor: my_policy ## ILM policy for the gravitee-monitor-* indexes request: my_policy ## ILM policy for the gravitee-request-* indexes