[APPC] use common templates for logs 06/106406/1
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>
Wed, 22 Apr 2020 08:37:45 +0000 (10:37 +0200)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Wed, 22 Apr 2020 08:48:49 +0000 (10:48 +0200)
Using the common templates for centralized logging.

Issue-ID: OOM-2370
Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com>
Change-Id: Ib0995b754597da36d06939199738cf93398e796a

kubernetes/appc/resources/config/log/filebeat/filebeat.yml [moved from kubernetes/appc/resources/config/log/filebeat/log4j/filebeat.yml with 100% similarity]
kubernetes/appc/templates/configmap.yaml
kubernetes/appc/templates/statefulset.yaml
kubernetes/appc/values.yaml

index 72dc617..fe206a9 100644 (file)
@@ -118,19 +118,6 @@ data:
 ---
 apiVersion: v1
 kind: ConfigMap
-metadata:
-  name: {{ include "common.fullname" . }}-filebeat
-  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/log4j/*").AsConfig . | indent 2 }}
----
-apiVersion: v1
-kind: ConfigMap
 metadata:
   name: {{ include "common.fullname" . }}-logging-cfg
   namespace: {{ include "common.namespace" . }}
@@ -141,3 +128,5 @@ metadata:
     heritage: {{ .Release.Service }}
 data:
 {{ tpl (.Files.Glob "resources/config/log/*").AsConfig . | indent 2 }}
+
+{{ include "common.log.configMap" . }}
index 5fd34ec..3480e63 100644 (file)
@@ -185,7 +185,7 @@ spec:
             subPath: installSdncDb.sh
           - mountPath: {{ .Values.persistence.mdsalPath }}
             name: {{ include "common.fullname" . }}-data
-          - mountPath: /var/log/onap
+          - mountPath: {{ .Values.log.path }}
             name: logs
           - mountPath: /opt/onap/appc/data/org.ops4j.pax.logging.cfg
             name: log-config
@@ -208,17 +208,7 @@ spec:
         {{- end }}
 
         # side car containers
-        - name: filebeat-onap
-          image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
-          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: logs
-          - mountPath: /usr/share/filebeat/data
-            name: data-filebeat
+        {{ include "common.log.sidecar" . | nindent 8 }}
       volumes:
         - name: keyfile-certs
           secret:
@@ -229,16 +219,12 @@ spec:
         - name: localtime
           hostPath:
             path: /etc/localtime
-        - name: filebeat-conf
-          configMap:
-            name: {{ include "common.fullname" . }}-filebeat
         - name: log-config
           configMap:
             name: {{ include "common.fullname" . }}-logging-cfg
         - name: logs
           emptyDir: {}
-        - name: data-filebeat
-          emptyDir: {}
+        {{ include "common.log.volumes" . | nindent 8 }}
         - name: onap-appc-data-properties-input
           configMap:
             name: {{ include "common.fullname" . }}-onap-appc-data-properties
index fb8230b..cde8920 100644 (file)
@@ -20,6 +20,7 @@ global:
   nodePortPrefix: 302
   readinessRepository: oomk8s
   readinessImage: readiness-check:2.0.0
+  centralizedLoggingEnabled: false
   loggingRepository: docker.elastic.co
   loggingImage: beats/filebeat:5.5.0
   # envsusbt
@@ -62,6 +63,10 @@ pullPolicy: Always
 # flag to enable debugging - application support required
 debugEnabled: false
 
+# log configuration
+log:
+  path: /var/log/onap
+
 # application configuration
 config:
 #  dbRootPassExternalSecret: some secret