From 7fad09d44ced460332b1e3c28c40231d8be74f28 Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Tue, 12 Nov 2024 16:31:47 +0500 Subject: [PATCH 1/2] Add logLevel, change chart by style guide --- .../configs/api/application.conf.template | 2 +- .../configs/api/{logback.xml => logback.xml.template} | 2 +- .../configs/streams/application.conf.template | 2 +- .../streams/{logback.xml => logback.xml.template} | 2 +- charts/stat-receiver/templates/api/configmap.yaml | 3 +-- charts/stat-receiver/templates/streams/configmap.yaml | 2 +- charts/stat-receiver/values.schema.json | 8 +++++++- charts/stat-receiver/values.yaml | 11 +++++++++++ 8 files changed, 24 insertions(+), 8 deletions(-) rename charts/stat-receiver/configs/api/{logback.xml => logback.xml.template} (89%) rename charts/stat-receiver/configs/streams/{logback.xml => logback.xml.template} (89%) diff --git a/charts/stat-receiver/configs/api/application.conf.template b/charts/stat-receiver/configs/api/application.conf.template index e31217005..ec7b31aad 100644 --- a/charts/stat-receiver/configs/api/application.conf.template +++ b/charts/stat-receiver/configs/api/application.conf.template @@ -8,7 +8,7 @@ schema-loader = { v-3-schemas-path = "file:///app/schema/v3/0/" } -initialize-topics = {{ required "A valid .Values.initializeTopics entry required" .Values.initializeTopics }} +initialize-topics = {{ required "A valid .Values.initializeTopics.enabled entry required" .Values.initializeTopics.enabled }} topics-manager.prefix = {{ required "A valid .Values.topicsPrefix entry required" .Values.topicsPrefix }} input-bss-topic = "{{ required "A valid .Values.topicsPrefix entry required" .Values.topicsPrefix }}input" diff --git a/charts/stat-receiver/configs/api/logback.xml b/charts/stat-receiver/configs/api/logback.xml.template similarity index 89% rename from charts/stat-receiver/configs/api/logback.xml rename to charts/stat-receiver/configs/api/logback.xml.template index fc91a7609..51ea1299b 100644 --- a/charts/stat-receiver/configs/api/logback.xml +++ b/charts/stat-receiver/configs/api/logback.xml.template @@ -14,7 +14,7 @@ - + diff --git a/charts/stat-receiver/configs/streams/application.conf.template b/charts/stat-receiver/configs/streams/application.conf.template index d34c24b4e..9cbf44b36 100644 --- a/charts/stat-receiver/configs/streams/application.conf.template +++ b/charts/stat-receiver/configs/streams/application.conf.template @@ -21,7 +21,7 @@ streams = { v-3-schemas-path = "file:///app/schema/v3/0/" } - initialize-topics = {{ required "A valid .Values.initializeTopics entry required" .Values.initializeTopics }} + initialize-topics = {{ required "A valid .Values.initializeTopics.enabled entry required" .Values.initializeTopics.enabled }} topics-manager.prefix = {{ required "A valid .Values.topicsPrefix entry required" .Values.topicsPrefix }} input-topics = [ diff --git a/charts/stat-receiver/configs/streams/logback.xml b/charts/stat-receiver/configs/streams/logback.xml.template similarity index 89% rename from charts/stat-receiver/configs/streams/logback.xml rename to charts/stat-receiver/configs/streams/logback.xml.template index 059276c93..1a3cc6ee8 100644 --- a/charts/stat-receiver/configs/streams/logback.xml +++ b/charts/stat-receiver/configs/streams/logback.xml.template @@ -12,7 +12,7 @@ - + diff --git a/charts/stat-receiver/templates/api/configmap.yaml b/charts/stat-receiver/templates/api/configmap.yaml index 4ee1e5b31..ca4f4abd3 100644 --- a/charts/stat-receiver/templates/api/configmap.yaml +++ b/charts/stat-receiver/templates/api/configmap.yaml @@ -10,5 +10,4 @@ data: application.conf: |- {{- tpl (.Files.Get "configs/api/application.conf.template") . | nindent 4 }} logback.xml: |- - {{- .Files.Get "configs/api/logback.xml" | nindent 4 }} - \ No newline at end of file + {{- tpl (.Files.Get "configs/api/logback.xml.template") . | nindent 4 }} diff --git a/charts/stat-receiver/templates/streams/configmap.yaml b/charts/stat-receiver/templates/streams/configmap.yaml index e0d797eed..b389b75b1 100644 --- a/charts/stat-receiver/templates/streams/configmap.yaml +++ b/charts/stat-receiver/templates/streams/configmap.yaml @@ -8,4 +8,4 @@ data: application.conf: |- {{- tpl (.Files.Get "configs/streams/application.conf.template") . | nindent 4 }} logback.xml: |- - {{- .Files.Get "configs/streams/logback.xml" | nindent 4 }} + {{- tpl (.Files.Get "configs/streams/logback.xml.template") . | nindent 4 }} diff --git a/charts/stat-receiver/values.schema.json b/charts/stat-receiver/values.schema.json index 528b0d978..0414dd245 100644 --- a/charts/stat-receiver/values.schema.json +++ b/charts/stat-receiver/values.schema.json @@ -9,7 +9,13 @@ { "$ref": "#/definitions/ip_or_host" } ] }, - "initializeTopics": { "type": "boolean" }, + "initializeTopics": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { "type": "boolean" } + } + }, "topicsPrefix": { "type": "string" }, "api": { "type": "object", diff --git a/charts/stat-receiver/values.yaml b/charts/stat-receiver/values.yaml index 5012833e0..22c7f738b 100644 --- a/charts/stat-receiver/values.yaml +++ b/charts/stat-receiver/values.yaml @@ -168,3 +168,14 @@ ingress: enabled: false hosts: - host: stat-receiver.host + +# @section stat-receiver parameters +# @param statReceiver.initializeTopics If true, topics will be created automatically. +# @param statReceiver.topicsPrefix Prefix for topics. + +initializeTopics: + enabled: false +topicsPrefix: '' + +# @param logLevel Log level: `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `OFF` +logLevel: INFO From 6c5487ae388adc97f71b9fa2241f857917f40f74 Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Thu, 14 Nov 2024 15:02:53 +0500 Subject: [PATCH 2/2] Update README --- charts/stat-receiver/README.md | 8 ++++++++ charts/stat-receiver/values.yaml | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/charts/stat-receiver/README.md b/charts/stat-receiver/README.md index 0444fdd00..3c3f44f1c 100644 --- a/charts/stat-receiver/README.md +++ b/charts/stat-receiver/README.md @@ -135,6 +135,14 @@ helm upgrade stat-receiver 2gis-on-premise/stat-receiver -f values-stat-receiver | `ingress.enabled` | If Ingress is enabled for the service. | `false` | | `ingress.hosts[0].host` | Hostname for the Ingress service. | `stat-receiver.host` | +### stat-receiver parameters + +| Name | Description | Value | +| -------------------------- | ----------------------------------------------------------- | ------- | +| `initializeTopics.enabled` | If true, topics will be created automatically. | `false` | +| `topicsPrefix` | Prefix for topics. | `""` | +| `logLevel` | Log level: `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `OFF` | `INFO` | + ## Maintainers diff --git a/charts/stat-receiver/values.yaml b/charts/stat-receiver/values.yaml index 22c7f738b..b6c9f6803 100644 --- a/charts/stat-receiver/values.yaml +++ b/charts/stat-receiver/values.yaml @@ -170,8 +170,8 @@ ingress: - host: stat-receiver.host # @section stat-receiver parameters -# @param statReceiver.initializeTopics If true, topics will be created automatically. -# @param statReceiver.topicsPrefix Prefix for topics. +# @param initializeTopics.enabled If true, topics will be created automatically. +# @param topicsPrefix Prefix for topics. initializeTopics: enabled: false