[DMAAP] Use log template 46/125646/1
authorMaciej Wereski <m.wereski@partner.samsung.com>
Thu, 4 Nov 2021 14:01:26 +0000 (14:01 +0000)
committerMaciej Wereski <m.wereski@partner.samsung.com>
Mon, 8 Nov 2021 16:55:12 +0000 (17:55 +0100)
Ability to turn off filebeat is needed as it is being deprecated. To
achieve that existing log helper template is used. Also unecessary
filebeat config map was removed.

Issue-ID: OOM-1
Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
Change-Id: I3dc384b0e2e857637897ac56a172a605de7eb67e

kubernetes/dmaap/components/dmaap-dr-node/templates/configmap.yaml
kubernetes/dmaap/components/dmaap-dr-node/templates/statefulset.yaml
kubernetes/dmaap/components/dmaap-dr-node/values.yaml
kubernetes/dmaap/components/dmaap-dr-prov/templates/configmap.yaml
kubernetes/dmaap/components/dmaap-dr-prov/templates/deployment.yaml
kubernetes/dmaap/components/dmaap-dr-prov/values.yaml
kubernetes/dmaap/templates/configmap.yaml [deleted file]

index e1a0b1c..597da17 100644 (file)
@@ -48,10 +48,4 @@ metadata:
 data:
 {{ tpl (.Files.Glob "resources/dr_nodes/*.json").AsConfig . | indent 2 }}
 ---
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: {{ include "common.fullname" . }}-dmaap-dr-node-filebeat-configmap
-  namespace: {{ include "common.namespace" . }}
-data:
-{{ tpl (.Files.Glob "resources/config/log/filebeat/filebeat.yml").AsConfig . | indent 2 }}
+{{ include "common.log.configMap" . }}
index 90db648..84a3c1e 100644 (file)
@@ -88,17 +88,7 @@ spec:
         affinity: {{ toYaml .Values.affinity | nindent 10 }}
         {{- end }}
         # Filebeat sidecar container
-        - name: {{ include "common.name" . }}-filebeat-onap
-          image: {{ include "repositoryGenerator.image.logging" . }}
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          volumeMounts:
-          - name: {{ include "common.fullname" . }}-filebeat-conf
-            mountPath: /usr/share/filebeat/filebeat.yml
-            subPath: filebeat.yml
-          - name: {{ include "common.fullname" . }}-data-filebeat
-            mountPath: /usr/share/filebeat/data
-          - name: {{ include "common.fullname" . }}-logs
-            mountPath: /var/log/onap/datarouter-node
+        {{ include "common.log.sidecar" . | nindent 8 }}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
@@ -115,11 +105,7 @@ spec:
         - name: {{ include "common.fullname" . }}-log-conf
           configMap:
             name: {{ include "common.fullname" . }}-log
-        - name: {{ include "common.fullname" . }}-filebeat-conf
-          configMap:
-            name: {{ include "common.fullname" . }}-dmaap-dr-node-filebeat-configmap
-        - name: {{ include "common.fullname" . }}-data-filebeat
-          emptyDir: {}
+        {{ include "common.log.volumes" . | nindent 8 }}
         - name:  {{ include "common.fullname" . }}-logs
           emptyDir: {}
       {{- if not .Values.persistence.enabled }}
index eb6a488..e34bc00 100644 (file)
@@ -19,6 +19,7 @@ global:
   loggingDirectory: /var/log/onap/datarouter
   persistence: {}
   aafEnabled: true
+  centralizedLoggingEnabled: true
 
 #################################################################
 # AAF part
@@ -156,3 +157,7 @@ serviceAccount:
   nameOverride: dmaap-dr-node
   roles:
     - read
+
+#Log configuration
+log:
+  path: /var/log/onap
index 1a0ca9f..9031cce 100644 (file)
@@ -35,13 +35,7 @@ metadata:
 data:
 {{ tpl (.Files.Glob "resources/config/logback.xml").AsConfig . | indent 2 }}
 ---
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: {{ include "common.fullname" . }}-dmaap-dr-prov-filebeat-configmap
-  namespace: {{ include "common.namespace" . }}
-data:
-{{ tpl (.Files.Glob "resources/config/log/filebeat/filebeat.yml").AsConfig . | indent 2 }}
+{{ include "common.log.configMap" . }}
 ---
 apiVersion: v1
 kind: ConfigMap
index a3051ee..5f99ea3 100644 (file)
@@ -107,17 +107,7 @@ spec:
 {{ toYaml .Values.affinity | indent 10 }}
         {{- end }}
       # Filebeat sidecar container
-        - name: {{ include "common.name" . }}-filebeat-onap
-          image: {{ include "repositoryGenerator.image.logging" . }}
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          volumeMounts:
-          - name: {{ include "common.fullname" . }}-filebeat-conf
-            mountPath: /usr/share/filebeat/filebeat.yml
-            subPath: filebeat.yml
-          - name: {{ include "common.fullname" . }}-data-filebeat
-            mountPath: /usr/share/filebeat/data
-          - name: {{ include "common.fullname" . }}-logs
-            mountPath: /var/log/onap/datarouter-prov
+        {{ include "common.log.sidecar" . | nindent 8 }}
       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
       volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
       - name: localtime
@@ -132,11 +122,7 @@ spec:
       - name: {{ include "common.fullname" . }}-log-conf
         configMap:
           name: {{ include "common.fullname" . }}-log
-      - name: {{ include "common.fullname" . }}-filebeat-conf
-        configMap:
-          name: {{ include "common.fullname" . }}-dmaap-dr-prov-filebeat-configmap
-      - name: {{ include "common.fullname" . }}-data-filebeat
-        emptyDir: {}
+      {{ include "common.log.volumes" . | nindent 6 }}
       - name:  {{ include "common.fullname" . }}-logs
         emptyDir: {}
       imagePullSecrets:
index a183356..1d9432a 100644 (file)
@@ -19,6 +19,7 @@ global:
   nodePortPrefix: 302
   loggingDirectory: /opt/app/datartr/logs
   persistence: {}
+  centralizedLoggingEnabled: true
   mariadbGalera: &mariadbGalera
     #This flag allows DMAAP-DR to instantiate its own mariadb-galera cluster
     localCluster: false
@@ -164,3 +165,7 @@ serviceAccount:
   nameOverride: dmaap-dr-prov
   roles:
     - read
+
+#Log configuration
+log:
+  path: /var/log/onap
diff --git a/kubernetes/dmaap/templates/configmap.yaml b/kubernetes/dmaap/templates/configmap.yaml
deleted file mode 100644 (file)
index 2a8e286..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-{{/*
-#
-# ============LICENSE_START=======================================================
-#  Copyright (C) 2019 Nordix Foundation.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-#
-*/}}
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: {{ include "common.release" . }}-dmaap-filebeat-configmap
-  namespace: {{ include "common.namespace" . }}
-data:
-{{ tpl (.Files.Glob "resources/config/log/filebeat/filebeat.yml").AsConfig . | indent 2 }}