[VID] Use log template 56/125756/2
authorMaciej Wereski <m.wereski@partner.samsung.com>
Mon, 15 Nov 2021 15:07:32 +0000 (16:07 +0100)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Tue, 16 Nov 2021 06:24:22 +0000 (06:24 +0000)
Ability to turn off filebeat is needed as it is  being deprecated. To
achieve that existing log helper template is used.

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

kubernetes/vid/templates/configmap.yaml
kubernetes/vid/templates/deployment.yaml
kubernetes/vid/values.yaml

index 0ba466d..5c423e6 100644 (file)
@@ -27,18 +27,7 @@ metadata:
 data:
 {{ tpl (.Files.Glob "resources/config/log/vid/*").AsConfig . | indent 2 }}
 ---
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: {{ include "common.fullname" . }}-filebeat-configmap
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ include "common.release" . }}
-    heritage: {{ .Release.Service }}
-data:
-{{ tpl (.Files.Glob "resources/config/log/filebeat/*").AsConfig . | indent 2 }}
+{{ include "common.log.configMap" . }}
 ---
 apiVersion: v1
 kind: ConfigMap
index 478b442..116a7cd 100644 (file)
@@ -136,7 +136,7 @@ spec:
           - mountPath: /etc/localtime
             name: localtime
             readOnly: true
-          - mountPath: /var/log/onap
+          - mountPath: "{{ .Values.log.path }}"
             name: vid-logs
           - mountPath: /tmp/logback.xml
             name: vid-logback
@@ -154,30 +154,16 @@ spec:
 {{ toYaml .Values.affinity | indent 10 }}
         {{- end }}
       # side car containers
-        - name: filebeat-onap
-          image: {{ include "repositoryGenerator.image.logging" . }}
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          volumeMounts:
-          - mountPath: /usr/share/filebeat/filebeat.yml
-            name: filebeat-conf
-            subPath: filebeat.yml
-          - mountPath: /var/log/onap
-            name: vid-logs
-          - mountPath: /usr/share/filebeat/data
-            name: vid-data-filebeat
+        {{ include "common.log.sidecar" . | nindent 8 }}
       volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
         - name: localtime
           hostPath:
             path: /etc/localtime
-        - name: filebeat-conf
-          configMap:
-            name: {{ include "common.fullname" . }}-filebeat-configmap
+        {{ include "common.log.volumes" . | nindent 8 }}
         - name: vid-cache
           emptyDir: {}
         - name: vid-logs
           emptyDir: {}
-        - name: vid-data-filebeat
-          emptyDir: {}
         - name: vid-logback
           configMap:
             name: {{ include "common.fullname" . }}-log-configmap
index 91132e2..aba010e 100644 (file)
@@ -25,6 +25,7 @@ global:
     service: mariadb-galera
     internalPort: 3306
     nameOverride: mariadb-galera
+  centralizedLoggingEnabled: true
 
 #################################################################
 # Secrets metaconfig
@@ -194,3 +195,7 @@ resources:
       cpu: 200m
       memory: 2Gi
   unlimited: {}
+
+# Log configuration
+log:
+  path: /var/log/onap