From 5c7d05143fa2bda0fcb0ff3d1411db4c8fcb5555 Mon Sep 17 00:00:00 2001 From: Nikolay Kolev Date: Fri, 8 Oct 2021 15:36:57 +0300 Subject: [PATCH 1/2] Fixed logback override when GraphDB helm chart is used as a subchart --- Chart.yaml | 2 +- files/config/logback.xml | 28 +++++++++++++++++++ .../graphdb-logback-configmap.yaml | 13 +++++++++ templates/graphdb-master.yaml | 13 +++++++-- templates/graphdb-worker.yaml | 13 +++++++-- 5 files changed, 64 insertions(+), 5 deletions(-) create mode 100644 templates/configuration/graphdb-logback-configmap.yaml diff --git a/Chart.yaml b/Chart.yaml index 47a09094..8e097996 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -5,7 +5,7 @@ apiVersion: v2 name: graphdb description: Helm chart for GraphDB Free/SE/EE type: application -version: 9.9.1-R2 +version: 9.9.1-R3 appVersion: 9.9.1 home: https://graphdb.ontotext.com/ icon: https://graphdb.ontotext.com/home/images/visual_Logo_GraphDB_02_12_2015.png diff --git a/files/config/logback.xml b/files/config/logback.xml index 2588650a..9e85401a 100644 --- a/files/config/logback.xml +++ b/files/config/logback.xml @@ -30,10 +30,20 @@ + + + + + + ${logDestinationDirectory}/audit-log-%d{yyyy-MM-dd}.log + ${keepLogDays} + ${logMaxSize} + true ${defaultPattern} @@ -44,6 +54,9 @@ ${logDestinationDirectory}/main-%d{yyyy-MM-dd}.log + ${keepLogDays} + ${logMaxSize} + true ${defaultPattern} @@ -54,6 +67,9 @@ ${logDestinationDirectory}/error-%d{yyyy-MM-dd}.log + ${keepLogDays} + ${logMaxSize} + true ${defaultPattern} @@ -68,6 +84,9 @@ ${logDestinationDirectory}/enterprise-log-%d{yyyy-MM-dd}.log + ${keepLogDays} + ${logMaxSize} + true ${defaultPattern} @@ -78,6 +97,9 @@ ${logDestinationDirectory}/http-log-%d{yyyy-MM-dd}.log + ${keepLogDays} + ${logMaxSize} + true ${defaultPattern} @@ -88,6 +110,9 @@ ${logDestinationDirectory}/query-log-%d{yyyy-MM-dd}.log + ${keepLogDays} + ${logMaxSize} + true ${defaultPattern} @@ -98,6 +123,9 @@ ${logDestinationDirectory}/slow-query-log-%d{yyyy-MM-dd}.log + ${keepLogDays} + ${logMaxSize} + true ${defaultPattern} diff --git a/templates/configuration/graphdb-logback-configmap.yaml b/templates/configuration/graphdb-logback-configmap.yaml new file mode 100644 index 00000000..6a287157 --- /dev/null +++ b/templates/configuration/graphdb-logback-configmap.yaml @@ -0,0 +1,13 @@ +# Default configuration map for provisioning GraphDB repository. +# To change it, prepare another configuration map and update "graphdb.repositoryConfigmap" +{{- if .Values.deployment.logbackConfigMap }} +apiVersion: {{ .Values.versions.configmap }} +kind: ConfigMap +metadata: + name: graphdb-logback-configmap + labels: + name: graphdb-logback-configmap +data: + logback.xml: |- +{{ tpl (.Files.Get "files/config/logback.xml" | indent 4) . }} +{{- end }} diff --git a/templates/graphdb-master.yaml b/templates/graphdb-master.yaml index c35fe2fd..f68a0734 100644 --- a/templates/graphdb-master.yaml +++ b/templates/graphdb-master.yaml @@ -63,6 +63,11 @@ spec: - name: graphdb-master-settings-config configMap: name: {{ required "Config map with settings.js (and graphdb.properties(optional) ) for security/settings provisioning is required!" $.Values.graphdb.masters.settingsConfigmap }} + {{- if $.Values.deployment.logbackConfigMap }} + - name: graphdb-logback-config + configMap: + name: {{ $.Values.deployment.logbackConfigMap }} + {{- end }} imagePullSecrets: {{- include "combinedImagePullSecrets" $ | nindent 8 }} nodeSelector: @@ -191,6 +196,10 @@ spec: mountPath: /opt/graphdb/home - name: graphdb-master-settings-config mountPath: /tmp/graphdb + {{- if $.Values.deployment.logbackConfigMap }} + - name: graphdb-logback-config + mountPath: /tmp/graphdb-configmap + {{- end }} command: ['sh', '-c'] args: - | @@ -205,10 +214,10 @@ spec: mkdir -p /opt/graphdb/home/conf ; cp /tmp/graphdb/graphdb.properties /opt/graphdb/home/conf/graphdb.properties fi - if [[ ! -f /opt/graphdb/home/conf/logback.xml && -f /tmp/graphdb/logback.xml ]]; then + if [[ ! -f /opt/graphdb/home/conf/logback.xml && -f /tmp/graphdb-configmap/logback.xml ]]; then echo "Provisioning logging config file..." mkdir -p /opt/graphdb/home/conf ; - cp /tmp/graphdb/logback.xml /opt/graphdb/home/conf/logback.xml + cp /tmp/graphdb-configmap/logback.xml /opt/graphdb/home/conf/logback.xml fi mkdir -p /opt/graphdb/home/jdbc-driver echo 'Done' diff --git a/templates/graphdb-worker.yaml b/templates/graphdb-worker.yaml index cd23797f..4aae09a5 100644 --- a/templates/graphdb-worker.yaml +++ b/templates/graphdb-worker.yaml @@ -51,6 +51,11 @@ spec: - name: graphdb-utils configMap: name: graphdb-utils-configmap + {{- if $.Values.deployment.logbackConfigMap }} + - name: graphdb-logback-config + configMap: + name: {{ $.Values.deployment.logbackConfigMap }} + {{- end }} {{- if and (eq $worker_index 1) (or $.Values.graphdb.tools.preload.trigger $.Values.graphdb.tools.loadrdf.trigger) }} - name: graphdb-worker-preload-data persistentVolumeClaim: @@ -175,6 +180,10 @@ spec: mountPath: /opt/graphdb/home - name: graphdb-master-settings-config mountPath: /tmp/graphdb + {{- if $.Values.deployment.logbackConfigMap }} + - name: graphdb-logback-config + mountPath: /tmp/graphdb-configmap + {{- end }} command: ['sh', '-c'] args: - | @@ -189,10 +198,10 @@ spec: mkdir -p /opt/graphdb/home/conf ; cp /tmp/graphdb/graphdb.properties /opt/graphdb/home/conf/graphdb.properties fi - if [[ ! -f /opt/graphdb/home/conf/logback.xml && -f /tmp/graphdb/logback.xml ]]; then + if [[ ! -f /opt/graphdb/home/conf/logback.xml && -f /tmp/graphdb-configmap/logback.xml ]]; then echo "Provisioning logging config file..." mkdir -p /opt/graphdb/home/conf ; - cp /tmp/graphdb/logback.xml /opt/graphdb/home/conf/logback.xml + cp /tmp/graphdb-configmap/logback.xml /opt/graphdb/home/conf/logback.xml fi mkdir -p /opt/graphdb/home/jdbc-driver echo 'Done' From 99b7b49f1cc38690f4c8e2779fec022eec6f9376 Mon Sep 17 00:00:00 2001 From: Nikolay Kolev Date: Fri, 8 Oct 2021 15:51:18 +0300 Subject: [PATCH 2/2] Updated example --- values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/values.yaml b/values.yaml index 46d1e9cd..98e0b818 100644 --- a/values.yaml +++ b/values.yaml @@ -79,7 +79,7 @@ deployment: read: 60 send: 60 # Override default logback configuration - # logbackConfigFile: files/config/logback.xml + # logbackConfigMap: graphdb-logback-configmap # KONG API gateway configurations. # This gateway sits behind the ingress and exposes the rest of the components.