From 4042f39c433654af21221e6e8417a8100fcc463e Mon Sep 17 00:00:00 2001
From: "Vadzim Beuzo  [EPAM / GCP]" <vadzim_beuzo@epam.com>
Date: Tue, 3 Sep 2024 16:16:07 +0000
Subject: [PATCH] GONRG-10103: add global log level to services

---
 NOTICE                                        |  2 +-
 devops/gc/deploy/README.md                    | 55 ++++++++++---------
 .../deploy/templates/register-variables.yml   |  2 +-
 devops/gc/deploy/values.yaml                  |  3 +-
 4 files changed, 32 insertions(+), 30 deletions(-)

diff --git a/NOTICE b/NOTICE
index 5e5c7cf57..c1260c2ed 100644
--- a/NOTICE
+++ b/NOTICE
@@ -67,7 +67,7 @@ The following software have components provided under the terms of this license:
 - Byte Buddy (without dependencies) (from https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy)
 - Byte Buddy Java agent (from https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent)
 - ClassMate (from http://github.com/cowtowncoder/java-classmate)
-- Cloud Key Management Service (KMS) API (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-cloudkms)
+- Cloud Key Management Service (KMS) API v1-rev20240801-2.0.0 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-cloudkms)
 - Collections (from https://repo1.maven.org/maven2/commons-collections/commons-collections)
 - Commons Digester (from http://commons.apache.org/digester/)
 - Converter: Jackson (from https://github.com/square/retrofit, https://repo1.maven.org/maven2/com/squareup/retrofit2/converter-jackson)
diff --git a/devops/gc/deploy/README.md b/devops/gc/deploy/README.md
index e1ea81198..6bcc6b8c9 100644
--- a/devops/gc/deploy/README.md
+++ b/devops/gc/deploy/README.md
@@ -32,56 +32,57 @@ First you need to set variables in **values.yaml** file using any code editor. S
 | Name | Description | Type | Default |Required |
 |------|-------------|------|---------|---------|
 **global.domain** | your domain for the external endpoint, ex `example.com` | string | - | yes
-**global.onPremEnabled** | whether on-prem is enabled | boolean | false | yes
-**global.limitsEnabled** | whether CPU and memory limits are enabled | boolean | true | yes
+**global.onPremEnabled** | whether on-prem is enabled | boolean | `false` | yes
+**global.limitsEnabled** | whether CPU and memory limits are enabled | boolean | `true` | yes
+**global.logLevel** | severity of logging level | string | `ERROR` | yes
 
 ### Configmap variables
 
 | Name | Description | Type | Default |Required |
 |------|-------------|------|---------|---------|
-**data.logLevel** | logging level | string | INFO | yes
+**data.logLevel** | logging severity level for this service only  | string | - | yes, only if differs from the `global.logLevel`
 **data.googleCloudProject** | your Google Cloud cloud project | string | -| yes
-**data.entitlementsHost** | Entitlements host | string | "<http://entitlements>" | yes
-**data.partitionHost** | Partition host | string | "<http://partition>" | yes
+**data.entitlementsHost** | Entitlements host | string | `http://entitlements` | yes
+**data.partitionHost** | Partition host | string | `http://partition` | yes
 **data.recordsChangedPubsubEndpoint** | Endpoint to PubSub topic | string | - | yes
-**data.storageHost** | Storage host | string | "<http://storage>" | yes
-**data.secretHost** | Secret host | string | "<http://secret>" | yes
-**data.serviceIdentity** | Service account in Google Cloud fo PubSub | string | "register-pubsub-identity" | yes
-**data.keyRing** | Type of keys | string | "csqp" | yes
-**data.kmsKey** | Key management service key (must be replaced during installation) | string | "registerService" | yes
-**data.subscriberPrivateKeyId** | Subscriber test private key id (must be replaced during installation) | string | "testkey" | yes
+**data.storageHost** | Storage host | string | `http://storage` | yes
+**data.secretHost** | Secret host | string | `http://secret` | yes
+**data.serviceIdentity** | Service account in Google Cloud fo PubSub | string | `register-pubsub-identity` | yes
+**data.keyRing** | Type of keys | string | `csqp` | yes
+**data.kmsKey** | Key management service key (must be replaced during installation) | string | `registerService` | yes
+**data.subscriberPrivateKeyId** | Subscriber test private key id (must be replaced during installation) | string | `testkey` | yes
 
 ### Deployment variables
 
 | Name | Description | Type | Default |Required |
 |------|-------------|------|---------|---------|
 **data.image** | your image name | string | - | yes
-**data.requestsCpu** | amount of requests CPU | string | 10m | yes
-**data.requestsMemory** | amount of requests memory| string | 450Mi | yes
-**data.limitsCpu** | CPU limit | string | 1.5 | only if `global.limitsEnabled` is true
-**data.limitsMemory** | memory limit | string | 1G | only if `global.limitsEnabled` is true
-**data.serviceAccountName** | name of your service account | string | register | yes
-**data.imagePullPolicy** | when to pull image | string | IfNotPresent | yes
+**data.requestsCpu** | amount of requests CPU | string | `10m` | yes
+**data.requestsMemory** | amount of requests memory| string | `450Mi` | yes
+**data.limitsCpu** | CPU limit | string | `1.5` | only if `global.limitsEnabled` is true
+**data.limitsMemory** | memory limit | string | `1G` | only if `global.limitsEnabled` is true
+**data.serviceAccountName** | name of your service account | string | `register` | yes
+**data.imagePullPolicy** | when to pull image | string | `IfNotPresent` | yes
 
 ### Config variables
 
 | Name | Description | Type | Default |Required |
 |------|-------------|------|---------|---------|
-**conf.appName** | name of the app | string | register | yes
-**conf.configmap** | configmap to be used | string | register-config | yes
-**conf.registerPostgresSecretName** | secret for postgres | string | register-postgres-secret | yes
-**conf.registerKeycloakSecretName** | secret for keycloak | string | register-keycloak-secret | yes
-**conf.registerKmsSecretName** | secret for kms | string |  "register-kms-secret" | yes
-**conf.rabbitmqSecretName** | secret for rabbitmq | string | rabbitmq-secret | yes
+**conf.appName** | name of the app | string | `register` | yes
+**conf.configmap** | configmap to be used | string | `register-config` | yes
+**conf.registerPostgresSecretName** | secret for postgres | string | `register-postgres-secret` | yes
+**conf.registerKeycloakSecretName** | secret for keycloak | string | `register-keycloak-secret` | yes
+**conf.registerKmsSecretName** | secret for kms | string |  `register-kms-secret` | yes
+**conf.rabbitmqSecretName** | secret for rabbitmq | string | `rabbitmq-secret` | yes
 
 ### ISTIO variables
 
 | Name | Description | Type | Default |Required |
 |------|-------------|------|---------|---------|
-**istio.proxyCPU** | CPU request for Envoy sidecars | string | 10m | yes
-**istio.proxyCPULimit** | CPU limit for Envoy sidecars | string | 200m | yes
-**istio.proxyMemory** | memory request for Envoy sidecars | string | 64Mi | yes
-**istio.proxyMemoryLimit** | memory limit for Envoy sidecars | string | 256Mi | yes
+**istio.proxyCPU** | CPU request for Envoy sidecars | string | `10m` | yes
+**istio.proxyCPULimit** | CPU limit for Envoy sidecars | string | `200m` | yes
+**istio.proxyMemory** | memory request for Envoy sidecars | string | `64Mi` | yes
+**istio.proxyMemoryLimit** | memory limit for Envoy sidecars | string | `256Mi` | yes
 
 ### Install the helm chart
 
diff --git a/devops/gc/deploy/templates/register-variables.yml b/devops/gc/deploy/templates/register-variables.yml
index b78d130f5..c628f5511 100644
--- a/devops/gc/deploy/templates/register-variables.yml
+++ b/devops/gc/deploy/templates/register-variables.yml
@@ -6,7 +6,7 @@ metadata:
   name: {{ .Values.conf.configmap | quote }}
   namespace: {{ .Release.Namespace | quote }}
 data:
-  LOG_LEVEL: {{ .Values.data.logLevel | quote }}
+  LOG_LEVEL: {{ .Values.data.logLevel | default .Values.global.logLevel | quote }}
   SUBSCRIBER_PRIVATE_KEY_ID: {{ .Values.data.subscriberPrivateKeyId | quote }}
   {{- if not .Values.global.onPremEnabled }}
   GOOGLE_CLOUD_PROJECT: {{ .Values.data.googleCloudProject  | quote }}
diff --git a/devops/gc/deploy/values.yaml b/devops/gc/deploy/values.yaml
index 9c39e1018..64d7312c5 100644
--- a/devops/gc/deploy/values.yaml
+++ b/devops/gc/deploy/values.yaml
@@ -6,10 +6,11 @@ global:
   domain: ""
   onPremEnabled: false
   limitsEnabled: true
+  logLevel: "ERROR"
 
 data:
   #Configmap
-  logLevel: "ERROR"
+  logLevel: ""
   googleCloudProject: ""
   entitlementsHost: "http://entitlements"
   partitionHost: "http://partition"
-- 
GitLab